diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java similarity index 95% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java index 1c18c4ef..8e510f04 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBar.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBar.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.content.Context; import android.content.res.Configuration; @@ -47,6 +47,7 @@ public class ActionBar extends FrameLayout { private ActionBarMenu menu; private ActionBarMenu actionMode; private View actionOverlay; + protected boolean isSearchFieldVisible; protected int itemsBackgroundResourceId; private boolean isBackOverlayVisible; @@ -69,23 +70,6 @@ public class ActionBar extends FrameLayout { titleFrameLayout.setLayoutParams(layoutParams); titleFrameLayout.setPadding(0, 0, AndroidUtilities.dp(4), 0); titleFrameLayout.setEnabled(false); - - backButtonImageView = new ImageView(getContext()); - titleFrameLayout.addView(backButtonImageView); - backButtonImageView.setVisibility(VISIBLE); - backButtonImageView.setScaleType(ImageView.ScaleType.CENTER); - backButtonImageView.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - if (isSearchFieldVisible) { - closeSearchField(); - return; - } - if (actionBarMenuOnItemClick != null) { - actionBarMenuOnItemClick.onItemClick(-1); - } - } - }); } private void positionBackImage(int height) { @@ -139,13 +123,20 @@ public class ActionBar extends FrameLayout { } int x = 0; - if (AndroidUtilities.isTablet()) { - x = AndroidUtilities.dp(80); + if (backButtonImageView != null) { + if (AndroidUtilities.isTablet()) { + x = AndroidUtilities.dp(80); + } else { + x = AndroidUtilities.dp(72); + } } else { - x = AndroidUtilities.dp(72); + if (AndroidUtilities.isTablet()) { + x = AndroidUtilities.dp(26); + } else { + x = AndroidUtilities.dp(18); + } } - if (menu != null) { maxTextWidth = Math.min(maxTextWidth, width - menu.getMeasuredWidth() - AndroidUtilities.dp(16)); } @@ -191,11 +182,39 @@ public class ActionBar extends FrameLayout { menu.measure(width, height); } + private void createBackButtonImage() { + if (backButtonImageView != null) { + return; + } + backButtonImageView = new ImageView(getContext()); + titleFrameLayout.addView(backButtonImageView); + backButtonImageView.setVisibility(VISIBLE); + backButtonImageView.setScaleType(ImageView.ScaleType.CENTER); + backButtonImageView.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + if (isSearchFieldVisible) { + closeSearchField(); + return; + } + if (actionBarMenuOnItemClick != null) { + actionBarMenuOnItemClick.onItemClick(-1); + } + } + }); + } + public void setBackButtonDrawable(Drawable drawable) { + if (backButtonImageView == null) { + createBackButtonImage(); + } backButtonImageView.setImageDrawable(drawable); } public void setBackButtonImage(int resource) { + if (backButtonImageView == null) { + createBackButtonImage(); + } backButtonImageView.setImageResource(resource); } @@ -485,7 +504,9 @@ public class ActionBar extends FrameLayout { public void setItemsBackground(int resourceId) { itemsBackgroundResourceId = resourceId; - backButtonImageView.setBackgroundResource(resourceId); + if (backButtonImageView != null) { + backButtonImageView.setBackgroundResource(resourceId); + } } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayout.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java index ca2ccad0..6a9bb5b0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.app.Activity; import android.content.Context; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java index fb2fd1ce..52ab4e38 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenu.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenu.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.content.Context; import android.util.AttributeSet; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index 07136665..e1fe066f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.content.Context; import android.graphics.Rect; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarPopupWindow.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarPopupWindow.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java index 698ab7c3..5e5a302b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/ActionBarPopupWindow.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarPopupWindow.java @@ -8,7 +8,7 @@ //Thanks to https://github.com/JakeWharton/ActionBarSherlock/ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.content.Context; import android.util.AttributeSet; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java index 811f6488..072ef79c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/BaseFragment.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.app.Activity; import android.app.AlertDialog; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/DrawerLayoutContainer.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/DrawerLayoutContainer.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java index d55b67c7..d67db6c3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/DrawerLayoutContainer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.app.Activity; import android.content.Context; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/MenuDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java similarity index 98% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/MenuDrawable.java rename to TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java index 221b1fd2..46f60170 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ActionBar/MenuDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/MenuDrawable.java @@ -6,7 +6,7 @@ * Copyright Nikolai Kudashov, 2013-2014. */ -package org.telegram.ui.Views.ActionBar; +package org.telegram.ui.ActionBar; import android.graphics.Canvas; import android.graphics.ColorFilter; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseFragmentAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseFragmentAdapter.java index 184e06a1..13196134 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseFragmentAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseFragmentAdapter.java @@ -15,12 +15,6 @@ import android.widget.BaseAdapter; public class BaseFragmentAdapter extends BaseAdapter { - public void onFragmentCreate() { - } - - public void onFragmentDestroy() { - } - @Override public int getCount() { return 0; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java index 0023f3ba..3b6023c7 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java @@ -120,7 +120,7 @@ public abstract class BaseSectionsAdapter extends BaseFragmentAdapter { } sectionStart = sectionEnd; } - return 0; + return -1; } public int getPositionInSectionForPosition(int position) { @@ -139,7 +139,7 @@ public abstract class BaseSectionsAdapter extends BaseFragmentAdapter { } sectionStart = sectionEnd; } - return 0; + return -1; } public abstract int getSectionCount(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java similarity index 98% rename from TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java rename to TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java index b995cf24..5a699507 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsAdapter.java @@ -28,14 +28,14 @@ import org.telegram.ui.Cells.UserCell; import java.util.ArrayList; import java.util.HashMap; -public class ContactsActivityAdapter extends BaseSectionsAdapter { +public class ContactsAdapter extends BaseSectionsAdapter { private Context mContext; private boolean onlyUsers; private boolean needPhonebook; private HashMap ignoreUsers; - public ContactsActivityAdapter(Context context, boolean arg1, boolean arg2, HashMap arg3) { + public ContactsAdapter(Context context, boolean arg1, boolean arg2, HashMap arg3) { mContext = context; onlyUsers = arg1; needPhonebook = arg2; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java similarity index 88% rename from TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java rename to TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java index 16f87e89..ab1b45f6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java @@ -24,26 +24,32 @@ import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.ui.Cells.GreySectionCell; import org.telegram.ui.Cells.ProfileSearchCell; +import org.telegram.ui.Cells.UserCell; import java.util.ArrayList; import java.util.HashMap; import java.util.Timer; import java.util.TimerTask; -public class ContactsActivitySearchAdapter extends BaseContactsSearchAdapter { +public class ContactsSearchAdapter extends BaseContactsSearchAdapter { private Context mContext; private HashMap ignoreUsers; private ArrayList searchResult = new ArrayList(); private ArrayList searchResultNames = new ArrayList(); private Timer searchTimer; private boolean allowUsernameSearch; + private boolean useUserCell; - public ContactsActivitySearchAdapter(Context context, HashMap arg1, boolean usernameSearch) { + public ContactsSearchAdapter(Context context, HashMap arg1, boolean usernameSearch) { mContext = context; ignoreUsers = arg1; allowUsernameSearch = usernameSearch; } + public void setUseUserCell(boolean value) { + useUserCell = value; + } + public void searchDialogs(final String query) { try { if (searchTimer != null) { @@ -202,10 +208,13 @@ public class ContactsActivitySearchAdapter extends BaseContactsSearchAdapter { } } else { if (view == null) { - view = new ProfileSearchCell(mContext); + if (useUserCell) { + view = new UserCell(mContext, 1); + } else { + view = new ProfileSearchCell(mContext); + } } - ((ProfileSearchCell) view).useSeparator = (i != getCount() - 1 && i != searchResult.size() - 1); TLRPC.User user = getItem(i); if (user != null) { CharSequence username = null; @@ -227,13 +236,16 @@ public class ContactsActivitySearchAdapter extends BaseContactsSearchAdapter { } } - ((ProfileSearchCell) view).setData(user, null, null, name, username); - - if (ignoreUsers != null) { - if (ignoreUsers.containsKey(user.id)) { - ((ProfileSearchCell) view).drawAlpha = 0.5f; - } else { - ((ProfileSearchCell) view).drawAlpha = 1.0f; + if (useUserCell) { + ((UserCell) view).setData(user, name, username, 0); + } else { + ((ProfileSearchCell) view).useSeparator = (i != getCount() - 1 && i != searchResult.size() - 1); + if (ignoreUsers != null) { + if (ignoreUsers.containsKey(user.id)) { + ((ProfileSearchCell) view).drawAlpha = 0.5f; + } else { + ((ProfileSearchCell) view).drawAlpha = 1.0f; + } } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountryAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountryAdapter.java new file mode 100644 index 00000000..389d17b8 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountryAdapter.java @@ -0,0 +1,165 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Adapters; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; + +import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; +import org.telegram.messenger.FileLog; +import org.telegram.ui.ApplicationLoader; +import org.telegram.ui.Cells.DividerCell; +import org.telegram.ui.Cells.LetterSectionCell; +import org.telegram.ui.Cells.TextSettingsCell; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; + +public class CountryAdapter extends BaseSectionsAdapter { + + public static class Country { + public String name; + public String code; + public String shortname; + } + + private Context mContext; + private HashMap> countries = new HashMap>(); + private ArrayList sortedCountries = new ArrayList(); + + public CountryAdapter(Context context) { + mContext = context; + + try { + InputStream stream = ApplicationLoader.applicationContext.getResources().getAssets().open("countries.txt"); + BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); + String line; + while ((line = reader.readLine()) != null) { + String[] args = line.split(";"); + Country c = new Country(); + c.name = args[2]; + c.code = args[0]; + c.shortname = args[1]; + String n = c.name.substring(0, 1).toUpperCase(); + ArrayList arr = countries.get(n); + if (arr == null) { + arr = new ArrayList(); + countries.put(n, arr); + sortedCountries.add(n); + } + arr.add(c); + } + reader.close(); + stream.close(); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + + Collections.sort(sortedCountries, new Comparator() { + @Override + public int compare(String lhs, String rhs) { + return lhs.compareTo(rhs); + } + }); + + for (ArrayList arr : countries.values()) { + Collections.sort(arr, new Comparator() { + @Override + public int compare(Country country, Country country2) { + return country.name.compareTo(country2.name); + } + }); + } + } + + public HashMap> getCountries() { + return countries; + } + + @Override + public Country getItem(int section, int position) { + if (section < 0 || section >= sortedCountries.size()) { + return null; + } + ArrayList arr = countries.get(sortedCountries.get(section)); + if (position < 0 || position >= arr.size()) { + return null; + } + return arr.get(position); + } + + @Override + public boolean isRowEnabled(int section, int row) { + ArrayList arr = countries.get(sortedCountries.get(section)); + return row < arr.size(); + } + + @Override + public int getSectionCount() { + return sortedCountries.size(); + } + + @Override + public int getCountForSection(int section) { + int count = countries.get(sortedCountries.get(section)).size(); + if (section != sortedCountries.size() - 1) { + count++; + } + return count; + } + + @Override + public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { + if (convertView == null) { + convertView = new LetterSectionCell(mContext); + ((LetterSectionCell) convertView).setCellHeight(AndroidUtilities.dp(48)); + } + ((LetterSectionCell) convertView).setLetter(sortedCountries.get(section).toUpperCase()); + return convertView; + } + + @Override + public View getItemView(int section, int position, View convertView, ViewGroup parent) { + int type = getItemViewType(section, position); + if (type == 1) { + if (convertView == null) { + convertView = new DividerCell(mContext); + convertView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 24 : 72), 0, AndroidUtilities.dp(LocaleController.isRTL ? 72 : 24), 0); + } + } else if (type == 0) { + if (convertView == null) { + convertView = new TextSettingsCell(mContext); + convertView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 16 : 54), 0, AndroidUtilities.dp(LocaleController.isRTL ? 54 : 16), 0); + } + + ArrayList arr = countries.get(sortedCountries.get(section)); + Country c = arr.get(position); + ((TextSettingsCell) convertView).setTextAndValue(c.name, "+" + c.code, false); + } + return convertView; + } + + @Override + public int getItemViewType(int section, int position) { + ArrayList arr = countries.get(sortedCountries.get(section)); + return position < arr.size() ? 0 : 1; + } + + @Override + public int getViewTypeCount() { + return 2; + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountrySearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountrySearchAdapter.java new file mode 100644 index 00000000..8414dd5b --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/CountrySearchAdapter.java @@ -0,0 +1,165 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Adapters; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; + +import org.telegram.android.AndroidUtilities; +import org.telegram.messenger.FileLog; +import org.telegram.messenger.Utilities; +import org.telegram.ui.Adapters.CountryAdapter.Country; +import org.telegram.ui.Cells.TextSettingsCell; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Timer; +import java.util.TimerTask; + +public class CountrySearchAdapter extends BaseFragmentAdapter { + + private Context mContext; + private Timer searchTimer; + private ArrayList searchResult; + private HashMap> countries; + + public CountrySearchAdapter(Context context, HashMap> countries) { + mContext = context; + this.countries = countries; + } + + public void search(final String query) { + if (query == null) { + searchResult = null; + } else { + try { + if (searchTimer != null) { + searchTimer.cancel(); + } + } catch (Exception e) { + FileLog.e("tmessages", e); + } + searchTimer = new Timer(); + searchTimer.schedule(new TimerTask() { + @Override + public void run() { + try { + searchTimer.cancel(); + searchTimer = null; + } catch (Exception e) { + FileLog.e("tmessages", e); + } + processSearch(query); + } + }, 100, 300); + } + } + + private void processSearch(final String query) { + Utilities.searchQueue.postRunnable(new Runnable() { + @Override + public void run() { + + String q = query.trim().toLowerCase(); + if (q.length() == 0) { + updateSearchResults(new ArrayList()); + return; + } + long time = System.currentTimeMillis(); + ArrayList resultArray = new ArrayList(); + + String n = query.substring(0, 1); + ArrayList arr = countries.get(n.toUpperCase()); + if (arr != null) { + for (Country c : arr) { + if (c.name.toLowerCase().startsWith(query)) { + resultArray.add(c); + } + } + } + + updateSearchResults(resultArray); + } + }); + } + + private void updateSearchResults(final ArrayList arrCounties) { + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + searchResult = arrCounties; + notifyDataSetChanged(); + } + }); + } + + @Override + public boolean areAllItemsEnabled() { + return true; + } + + @Override + public boolean isEnabled(int i) { + return true; + } + + @Override + public int getCount() { + if (searchResult == null) { + return 0; + } + return searchResult.size(); + } + + @Override + public Country getItem(int i) { + if (i < 0 || i >= searchResult.size()) { + return null; + } + return searchResult.get(i); + } + + @Override + public long getItemId(int i) { + return i; + } + + @Override + public boolean hasStableIds() { + return true; + } + + @Override + public View getView(int i, View view, ViewGroup viewGroup) { + if (view == null) { + view = new TextSettingsCell(mContext); + } + + Country c = searchResult.get(i); + ((TextSettingsCell) view).setTextAndValue(c.name, "+" + c.code, i != searchResult.size() - 1); + + return view; + } + + @Override + public int getItemViewType(int i) { + return 0; + } + + @Override + public int getViewTypeCount() { + return 1; + } + + @Override + public boolean isEmpty() { + return searchResult == null || searchResult.size() == 0; + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivityAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java similarity index 96% rename from TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivityAdapter.java rename to TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java index 9533d38c..afa3db16 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivityAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsAdapter.java @@ -20,13 +20,13 @@ import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.ui.Cells.DialogCell; -public class MessagesActivityAdapter extends BaseFragmentAdapter { +public class DialogsAdapter extends BaseFragmentAdapter { private Context mContext; private boolean serverOnly; private long openedDialogId; - public MessagesActivityAdapter(Context context, boolean onlyFromServer) { + public DialogsAdapter(Context context, boolean onlyFromServer) { mContext = context; serverOnly = onlyFromServer; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java rename to TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java index 348cb493..2a680d84 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java @@ -38,7 +38,7 @@ import java.util.ArrayList; import java.util.Timer; import java.util.TimerTask; -public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { +public class DialogsSearchAdapter extends BaseContactsSearchAdapter { private Context mContext; private Timer searchTimer; private ArrayList searchResult = new ArrayList(); @@ -53,7 +53,7 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { public abstract void searchStateChanged(boolean searching); } - public MessagesActivitySearchAdapter(Context context) { + public DialogsSearchAdapter(Context context) { mContext = context; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Animation/ObjectAnimator10.java b/TMessagesProj/src/main/java/org/telegram/ui/Animation/ObjectAnimator10.java index 6aa87d56..9f7ea736 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Animation/ObjectAnimator10.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Animation/ObjectAnimator10.java @@ -18,8 +18,6 @@ package org.telegram.ui.Animation; import android.view.View; -import org.telegram.ui.Views.ActionBar.ActionBarLayout; - import java.util.HashMap; public final class ObjectAnimator10 extends ValueAnimator { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java similarity index 96% rename from TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java index b7504f7b..5d361b09 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java @@ -33,11 +33,11 @@ import org.telegram.messenger.R; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.TextInfoCell; import org.telegram.ui.Cells.UserCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; -public class SettingsBlockedUsersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, ContactsActivity.ContactsActivityDelegate { +public class BlockedUsersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, ContactsActivity.ContactsActivityDelegate { private ListView listView; private ListAdapter listViewAdapter; private FrameLayout progressView; @@ -79,7 +79,7 @@ public class SettingsBlockedUsersActivity extends BaseFragment implements Notifi args.putBoolean("destroyAfterSelect", true); args.putBoolean("returnAsResult", true); ContactsActivity fragment = new ContactsActivity(args); - fragment.setDelegate(SettingsBlockedUsersActivity.this); + fragment.setDelegate(BlockedUsersActivity.this); presentFragment(fragment); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index 9c385265..3f04768a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -109,7 +109,7 @@ public class DialogCell extends BaseCell { if (namePaint == null) { namePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); namePaint.setTextSize(AndroidUtilities.dp(17)); - namePaint.setColor(0xff222222); + namePaint.setColor(0xff212121); namePaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); nameEncryptedPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java index ad385f98..40e5b3a1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java @@ -40,4 +40,8 @@ public class LetterSectionCell extends FrameLayout { public void setLetter(String letter) { textView.setText(letter.toUpperCase()); } + + public void setCellHeight(int height) { + setLayoutParams(new ViewGroup.LayoutParams(AndroidUtilities.dp(54), height)); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java index b8d5ac16..40ac4026 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java @@ -79,7 +79,7 @@ public class ProfileSearchCell extends BaseCell { if (namePaint == null) { namePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); namePaint.setTextSize(AndroidUtilities.dp(17)); - namePaint.setColor(0xff222222); + namePaint.setColor(0xff212121); namePaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); nameEncryptedPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java index 4d56c03e..5a3baf8c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSettingsCell.java @@ -11,6 +11,7 @@ package org.telegram.ui.Cells; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; +import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; @@ -41,10 +42,11 @@ public class TextSettingsCell extends FrameLayout { textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); + textView.setEllipsize(TextUtils.TruncateAt.END); textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); addView(textView); LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); - layoutParams.width = LayoutParams.MATCH_PARENT; + layoutParams.width = LayoutParams.WRAP_CONTENT; layoutParams.height = LayoutParams.MATCH_PARENT; layoutParams.leftMargin = AndroidUtilities.dp(17); layoutParams.rightMargin = AndroidUtilities.dp(17); @@ -57,6 +59,7 @@ public class TextSettingsCell extends FrameLayout { valueTextView.setLines(1); valueTextView.setMaxLines(1); valueTextView.setSingleLine(true); + valueTextView.setEllipsize(TextUtils.TruncateAt.END); valueTextView.setGravity((LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL); addView(valueTextView); layoutParams = (LayoutParams) valueTextView.getLayoutParams(); @@ -70,7 +73,17 @@ public class TextSettingsCell extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(48) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY)); + setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(48) + (needDivider ? 1 : 0)); + + int availableWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - AndroidUtilities.dp(34); + int width = availableWidth / 2; + if (valueTextView.getVisibility() == VISIBLE) { + valueTextView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); + width = availableWidth - valueTextView.getMeasuredWidth() - AndroidUtilities.dp(8); + } else { + width = availableWidth; + } + textView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); } public void setTextColor(int color) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java index 795e80d1..e17397a8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java @@ -12,6 +12,7 @@ import android.content.Context; import android.text.TextUtils; import android.util.TypedValue; import android.view.Gravity; +import android.widget.CheckBox; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; @@ -33,6 +34,7 @@ public class UserCell extends FrameLayout { private TextView nameTextView; private TextView statusTextView; private ImageView imageView; + private CheckBox checkBox; private AvatarDrawable avatarDrawable; private TLRPC.User currentUser = null; @@ -65,7 +67,7 @@ public class UserCell extends FrameLayout { avatarDrawable = new AvatarDrawable(); nameTextView = new TextView(context); - nameTextView.setTextColor(0xff000000); + nameTextView.setTextColor(0xff212121); nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 17); nameTextView.setLines(1); nameTextView.setMaxLines(1); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChangeChatNameActivity.java similarity index 74% rename from TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/ChangeChatNameActivity.java index 461672d5..210dbf57 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChangeChatNameActivity.java @@ -19,7 +19,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; -import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; @@ -29,16 +28,20 @@ import org.telegram.android.LocaleController; import org.telegram.messenger.TLRPC; import org.telegram.android.MessagesController; import org.telegram.messenger.R; -import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; + +public class ChangeChatNameActivity extends BaseFragment { -public class ChatProfileChangeNameActivity extends BaseFragment { private EditText firstNameField; private View headerLabelView; private int chat_id; private View doneButton; - public ChatProfileChangeNameActivity(Bundle args) { + private final static int done_button = 1; + + public ChangeChatNameActivity(Bundle args) { super(args); } @@ -52,40 +55,34 @@ public class ChatProfileChangeNameActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + actionBar.setTitle(LocaleController.getString("EditName", R.string.EditName)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (firstNameField.getText().length() != 0) { - saveName(); + public void onItemClick(int id) { + if (id == -1) { finishFragment(); + } else if (id == done_button) { + if (firstNameField.getText().length() != 0) { + saveName(); + finishFragment(); + } } } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + doneButton = menu.addItem(done_button, R.drawable.ic_done); TLRPC.Chat currentChat = MessagesController.getInstance().getChat(chat_id); fragmentView = new LinearLayout(inflater.getContext()); fragmentView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); - fragmentView.setPadding(AndroidUtilities.dp(16), AndroidUtilities.dp(8), AndroidUtilities.dp(16), 0); + fragmentView.setPadding(0, AndroidUtilities.dp(8), 0, 0); ((LinearLayout) fragmentView).setOrientation(LinearLayout.VERTICAL); - SettingsSectionLayout settingsSectionLayout = new SettingsSectionLayout(inflater.getContext()); - ((LinearLayout) fragmentView).addView(settingsSectionLayout); - firstNameField = new EditText(inflater.getContext()); firstNameField.setText(currentChat.title); firstNameField.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 19); @@ -114,15 +111,15 @@ public class ChatProfileChangeNameActivity extends BaseFragment { ((LinearLayout) fragmentView).addView(firstNameField); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)firstNameField.getLayoutParams(); layoutParams.topMargin = AndroidUtilities.dp(15); + layoutParams.leftMargin = AndroidUtilities.dp(16); + layoutParams.rightMargin = AndroidUtilities.dp(16); layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; layoutParams.height = LinearLayout.LayoutParams.WRAP_CONTENT; firstNameField.setLayoutParams(layoutParams); if (chat_id > 0) { - settingsSectionLayout.setText(LocaleController.getString("EnterGroupNameTitle", R.string.EnterGroupNameTitle)); firstNameField.setHint(LocaleController.getString("GroupName", R.string.GroupName)); } else { - settingsSectionLayout.setText(LocaleController.getString("EnterListName", R.string.EnterListName).toUpperCase()); firstNameField.setHint(LocaleController.getString("EnterListName", R.string.EnterListName)); } firstNameField.setSelection(firstNameField.length()); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChangeNameActivity.java similarity index 88% rename from TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/ChangeNameActivity.java index bc3c78b4..90967404 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChangeNameActivity.java @@ -18,7 +18,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; -import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; @@ -33,40 +32,44 @@ import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.RPCRequest; import org.telegram.messenger.UserConfig; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SettingsSectionLayout; -public class SettingsChangeNameActivity extends BaseFragment { +public class ChangeNameActivity extends BaseFragment { + private EditText firstNameField; private EditText lastNameField; private View headerLabelView; private View doneButton; + private final static int done_button = 1; + @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + actionBar.setTitle(LocaleController.getString("EditName", R.string.EditName)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (firstNameField.getText().length() != 0) { - saveName(); + public void onItemClick(int id) { + if (id == -1) { finishFragment(); + } else if (id == done_button) { + if (firstNameField.getText().length() != 0) { + saveName(); + finishFragment(); + } } } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + doneButton = menu.addItem(done_button, R.drawable.ic_done); + + fragmentView = inflater.inflate(R.layout.contact_add_layout, container, false); TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId()); if (user == null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeUsernameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChangeUsernameActivity.java similarity index 94% rename from TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeUsernameActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/ChangeUsernameActivity.java index 3941c422..3f78310a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeUsernameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChangeUsernameActivity.java @@ -24,7 +24,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; -import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; @@ -41,12 +40,14 @@ import org.telegram.messenger.RPCRequest; import org.telegram.messenger.TLObject; import org.telegram.messenger.TLRPC; import org.telegram.messenger.UserConfig; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SettingsSectionLayout; import java.util.ArrayList; -public class SettingsChangeUsernameActivity extends BaseFragment { +public class ChangeUsernameActivity extends BaseFragment { private EditText firstNameField; private View doneButton; @@ -56,28 +57,27 @@ public class SettingsChangeUsernameActivity extends BaseFragment { private Runnable checkRunnable = null; private boolean lastNameAvailable = false; + private final static int done_button = 1; + @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + actionBar.setTitle(LocaleController.getString("Username", R.string.Username)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - saveName(); + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } else if (id == done_button) { + saveName(); + } } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + doneButton = menu.addItem(done_button, R.drawable.ic_done); TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId()); if (user == null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index f6286ab7..527d3cb8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -71,12 +71,12 @@ import org.telegram.ui.Cells.ChatBaseCell; import org.telegram.ui.Cells.ChatContactCell; import org.telegram.ui.Cells.ChatMediaCell; import org.telegram.ui.Cells.ChatMessageCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.ChatActivityEnterView; import org.telegram.android.ImageReceiver; import org.telegram.ui.Views.LayoutListView; @@ -2364,6 +2364,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not public void onClick(View v) { Bundle args = new Bundle(); args.putInt("user_id", currentUser.id); + args.putBoolean("addContact", true); presentFragment(new ContactAddActivity(args)); } }); @@ -3292,6 +3293,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not Bundle args = new Bundle(); args.putInt("user_id", messageObject.messageOwner.media.user_id); args.putString("phone", messageObject.messageOwner.media.phone_number); + args.putBoolean("addContact", true); presentFragment(new ContactAddActivity(args)); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java index d4c2f7ef..670eee6c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java @@ -17,7 +17,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; -import android.widget.Button; import android.widget.EditText; import android.widget.TextView; @@ -29,13 +28,14 @@ import org.telegram.messenger.TLRPC; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; public class ContactAddActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { - private int user_id; - private String phone = null; + private View doneButton; private EditText firstNameField; private EditText lastNameField; @@ -43,6 +43,12 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent private TextView onlineText; private TextView phoneText; + private int user_id; + private boolean addContact; + private String phone = null; + + private final static int done_button = 1; + public ContactAddActivity(Bundle args) { super(args); } @@ -52,6 +58,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent NotificationCenter.getInstance().addObserver(this, NotificationCenter.updateInterfaces); user_id = getArguments().getInt("user_id", 0); phone = getArguments().getString("phone"); + addContact = getArguments().getBoolean("addContact", false); TLRPC.User user = MessagesController.getInstance().getUser(user_id); return user != null && super.onFragmentCreate(); } @@ -65,32 +72,33 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + if (addContact) { + actionBar.setTitle(LocaleController.getString("AddContactTitle", R.string.AddContactTitle)); + } else { + actionBar.setTitle(LocaleController.getString("EditName", R.string.EditName)); + } + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (firstNameField.getText().length() != 0) { - TLRPC.User user = MessagesController.getInstance().getUser(user_id); - user.first_name = firstNameField.getText().toString(); - user.last_name = lastNameField.getText().toString(); - ContactsController.getInstance().addContact(user); + public void onItemClick(int id) { + if (id == -1) { finishFragment(); - NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_NAME); + } else if (id == done_button) { + if (firstNameField.getText().length() != 0) { + TLRPC.User user = MessagesController.getInstance().getUser(user_id); + user.first_name = firstNameField.getText().toString(); + user.last_name = lastNameField.getText().toString(); + ContactsController.getInstance().addContact(user); + finishFragment(); + NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_NAME); + } } } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + doneButton = menu.addItem(done_button, R.drawable.ic_done); fragmentView = inflater.inflate(R.layout.contact_add_layout, container, false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 5e415490..f6716a91 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -39,13 +39,13 @@ import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.ui.Adapters.BaseSectionsAdapter; -import org.telegram.ui.Adapters.ContactsActivityAdapter; -import org.telegram.ui.Adapters.ContactsActivitySearchAdapter; +import org.telegram.ui.Adapters.ContactsAdapter; +import org.telegram.ui.Adapters.ContactsSearchAdapter; import org.telegram.ui.Cells.UserCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SectionsListView; import java.util.ArrayList; @@ -56,7 +56,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter private BaseSectionsAdapter listViewAdapter; private TextView emptyTextView; private SectionsListView listView; - private ContactsActivitySearchAdapter searchListViewAdapter; + private ContactsSearchAdapter searchListViewAdapter; private boolean searchWas; private boolean searching; @@ -150,7 +150,6 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } listView.setFastScrollEnabled(true); listView.setVerticalScrollBarEnabled(false); - emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); } @@ -179,8 +178,8 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } }); - searchListViewAdapter = new ContactsActivitySearchAdapter(getParentActivity(), ignoreUsers, allowUsernameSearch); - listViewAdapter = new ContactsActivityAdapter(getParentActivity(), onlyUsers, needPhonebook, ignoreUsers); + searchListViewAdapter = new ContactsSearchAdapter(getParentActivity(), ignoreUsers, allowUsernameSearch); + listViewAdapter = new ContactsAdapter(getParentActivity(), onlyUsers, needPhonebook, ignoreUsers); fragmentView = new FrameLayout(getParentActivity()); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java index c687be75..890ff660 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java @@ -8,40 +8,30 @@ package org.telegram.ui; -import android.content.Context; +import android.os.Build; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; -import android.widget.BaseAdapter; import android.widget.EditText; +import android.widget.FrameLayout; +import android.widget.ListView; import android.widget.TextView; import org.telegram.android.AndroidUtilities; -import org.telegram.messenger.FileLog; import org.telegram.android.LocaleController; import org.telegram.messenger.R; -import org.telegram.messenger.Utilities; -import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; -import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.PinnedHeaderListView; -import org.telegram.ui.Views.SectionedBaseAdapter; -import org.telegram.ui.Views.SettingsSectionLayout; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Timer; -import java.util.TimerTask; +import org.telegram.ui.Adapters.CountryAdapter; +import org.telegram.ui.Adapters.CountryAdapter.Country; +import org.telegram.ui.Adapters.CountrySearchAdapter; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.Views.SectionsListView; public class CountrySelectActivity extends BaseFragment { @@ -49,68 +39,18 @@ public class CountrySelectActivity extends BaseFragment { public abstract void didSelectCountry(String name); } - private SectionedBaseAdapter listViewAdapter; - private PinnedHeaderListView listView; + private SectionsListView listView; + private TextView emptyTextView; + private CountryAdapter listViewAdapter; + private CountrySearchAdapter searchListViewAdapter; + private boolean searchWas; private boolean searching; - private BaseAdapter searchListViewAdapter; - private TextView emptyTextView; - private HashMap> countries = new HashMap>(); - private ArrayList sortedCountries = new ArrayList(); + private CountrySelectActivityDelegate delegate; - private Timer searchTimer; - public ArrayList searchResult; - - public static class Country { - public String name; - public String code; - public String shortname; - } - @Override public boolean onFragmentCreate() { - try { - InputStream stream = ApplicationLoader.applicationContext.getResources().getAssets().open("countries.txt"); - BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); - String line; - while ((line = reader.readLine()) != null) { - String[] args = line.split(";"); - Country c = new Country(); - c.name = args[2]; - c.code = args[0]; - c.shortname = args[1]; - String n = c.name.substring(0, 1).toUpperCase(); - ArrayList arr = countries.get(n); - if (arr == null) { - arr = new ArrayList(); - countries.put(n, arr); - sortedCountries.add(n); - } - arr.add(c); - } - reader.close(); - stream.close(); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - - Collections.sort(sortedCountries, new Comparator() { - @Override - public int compare(String lhs, String rhs) { - return lhs.compareTo(rhs); - } - }); - - for (ArrayList arr : countries.values()) { - Collections.sort(arr, new Comparator() { - @Override - public int compare(Country country, Country country2) { - return country.name.compareTo(country2.name); - } - }); - } - return super.onFragmentCreate(); } @@ -120,7 +60,7 @@ public class CountrySelectActivity extends BaseFragment { } @Override - public View createView(LayoutInflater inflater, ViewGroup container) { + public View createView(LayoutInflater inflater, final ViewGroup container) { if (fragmentView == null) { actionBar.setBackButtonImage(R.drawable.ic_ab_back); actionBar.setBackOverlay(R.layout.updating_state_layout); @@ -144,16 +84,11 @@ public class CountrySelectActivity extends BaseFragment { @Override public void onSearchCollapse() { - search(null); + searchListViewAdapter.search(null); searching = false; searchWas = false; ViewGroup group = (ViewGroup) listView.getParent(); listView.setAdapter(listViewAdapter); - if (!LocaleController.isRTL) { - listView.setPadding(AndroidUtilities.dp(16), listView.getPaddingTop(), AndroidUtilities.dp(30), listView.getPaddingBottom()); - } else { - listView.setPadding(AndroidUtilities.dp(30), listView.getPaddingTop(), AndroidUtilities.dp(16), listView.getPaddingBottom()); - } if (android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(true); } @@ -166,11 +101,10 @@ public class CountrySelectActivity extends BaseFragment { @Override public void onTextChanged(EditText editText) { String text = editText.getText().toString(); - search(text); + searchListViewAdapter.search(text); if (text.length() != 0) { searchWas = true; if (listView != null) { - listView.setPadding(AndroidUtilities.dp(16), listView.getPaddingTop(), AndroidUtilities.dp(16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); if(android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(false); @@ -179,7 +113,7 @@ public class CountrySelectActivity extends BaseFragment { listView.setVerticalScrollBarEnabled(true); } if (emptyTextView != null) { - emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); + } } } @@ -188,51 +122,69 @@ public class CountrySelectActivity extends BaseFragment { searching = false; searchWas = false; - fragmentView = inflater.inflate(R.layout.country_select_layout, container, false); + listViewAdapter = new CountryAdapter(getParentActivity()); + searchListViewAdapter = new CountrySearchAdapter(getParentActivity(), listViewAdapter.getCountries()); - emptyTextView = (TextView)fragmentView.findViewById(R.id.searchEmptyView); - searchListViewAdapter = new SearchAdapter(getParentActivity()); + fragmentView = new FrameLayout(getParentActivity()); - listView = (PinnedHeaderListView)fragmentView.findViewById(R.id.listView); - listView.setEmptyView(emptyTextView); + emptyTextView = new TextView(getParentActivity()); + emptyTextView.setTextColor(0xff808080); + emptyTextView.setTextSize(24); + emptyTextView.setGravity(Gravity.CENTER); + emptyTextView.setVisibility(View.INVISIBLE); + emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); + ((FrameLayout) fragmentView).addView(emptyTextView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) emptyTextView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.gravity = Gravity.TOP; + emptyTextView.setLayoutParams(layoutParams); emptyTextView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); - listView.setVerticalScrollBarEnabled(false); - listView.setAdapter(listViewAdapter = new ListAdapter(getParentActivity())); + listView = new SectionsListView(getParentActivity()); + listView.setEmptyView(emptyTextView); + listView.setVerticalScrollBarEnabled(false); + listView.setDivider(null); + listView.setDividerHeight(0); + listView.setFastScrollEnabled(true); + listView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); + listView.setAdapter(listViewAdapter); + if (Build.VERSION.SDK_INT >= 11) { + listView.setFastScrollAlwaysVisible(true); + listView.setVerticalScrollbarPosition(LocaleController.isRTL ? ListView.SCROLLBAR_POSITION_LEFT : ListView.SCROLLBAR_POSITION_RIGHT); + } + ((FrameLayout) fragmentView).addView(listView); + layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(layoutParams); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { - if (i < 0) { - return; - } + Country country = null; if (searching && searchWas) { - if (i >= 0 && i < searchResult.size()) { - Country c = searchResult.get(i); - if (delegate != null) { - delegate.didSelectCountry(c.name); - } - finishFragment(); - } + country = searchListViewAdapter.getItem(i); } else { int section = listViewAdapter.getSectionForPosition(i); int row = listViewAdapter.getPositionInSectionForPosition(i); - if (section >= 0 && section < sortedCountries.size()) { - String n = sortedCountries.get(section); - ArrayList arr = countries.get(n); - if (row >= 0 && row < arr.size()) { - Country c = arr.get(row); - if (delegate != null) { - delegate.didSelectCountry(c.name); - } - finishFragment(); - } + if (row < 0 || section < 0) { + return; } + country = listViewAdapter.getItem(section, row); } + if (i < 0) { + return; + } + if (country != null && delegate != null) { + delegate.didSelectCountry(country.name); + } + finishFragment(); } }); @@ -265,234 +217,7 @@ public class CountrySelectActivity extends BaseFragment { } } - public void search(final String query) { - if (query == null) { - searchResult = null; - } else { - try { - if (searchTimer != null) { - searchTimer.cancel(); - } - } catch (Exception e) { - FileLog.e("tmessages", e); - } - searchTimer = new Timer(); - searchTimer.schedule(new TimerTask() { - @Override - public void run() { - try { - searchTimer.cancel(); - searchTimer = null; - } catch (Exception e) { - FileLog.e("tmessages", e); - } - processSearch(query); - } - }, 100, 300); - } - } - - private void processSearch(final String query) { - Utilities.searchQueue.postRunnable(new Runnable() { - @Override - public void run() { - - String q = query.trim().toLowerCase(); - if (q.length() == 0) { - updateSearchResults(new ArrayList()); - return; - } - long time = System.currentTimeMillis(); - ArrayList resultArray = new ArrayList(); - - String n = query.substring(0, 1); - ArrayList arr = countries.get(n.toUpperCase()); - if (arr != null) { - for (Country c : arr) { - if (c.name.toLowerCase().startsWith(query)) { - resultArray.add(c); - } - } - } - - updateSearchResults(resultArray); - } - }); - } - public void setCountrySelectActivityDelegate(CountrySelectActivityDelegate delegate) { this.delegate = delegate; } - - private void updateSearchResults(final ArrayList arrCounties) { - AndroidUtilities.runOnUIThread(new Runnable() { - @Override - public void run() { - searchResult = arrCounties; - searchListViewAdapter.notifyDataSetChanged(); - } - }); - } - - private class SearchAdapter extends BaseFragmentAdapter { - private Context mContext; - - public SearchAdapter(Context context) { - mContext = context; - } - - @Override - public boolean areAllItemsEnabled() { - return true; - } - - @Override - public boolean isEnabled(int i) { - return true; - } - - @Override - public int getCount() { - if (searchResult == null) { - return 0; - } - return searchResult.size(); - } - - @Override - public Object getItem(int i) { - return null; - } - - @Override - public long getItemId(int i) { - return i; - } - - @Override - public boolean hasStableIds() { - return false; - } - - @Override - public View getView(int i, View view, ViewGroup viewGroup) { - if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.country_row_layout, viewGroup, false); - } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail); - View divider = view.findViewById(R.id.settings_row_divider); - - Country c = searchResult.get(i); - textView.setText(c.name); - detailTextView.setText("+" + c.code); - if (i == searchResult.size() - 1) { - divider.setVisibility(View.GONE); - } else { - divider.setVisibility(View.VISIBLE); - } - - return view; - } - - @Override - public int getItemViewType(int i) { - return 0; - } - - @Override - public int getViewTypeCount() { - return 1; - } - - @Override - public boolean isEmpty() { - return searchResult == null || searchResult.size() == 0; - } - } - - private class ListAdapter extends SectionedBaseAdapter { - private Context mContext; - - public ListAdapter(Context context) { - mContext = context; - } - - @Override - public Object getItem(int section, int position) { - return null; - } - - @Override - public long getItemId(int section, int position) { - return 0; - } - - @Override - public int getSectionCount() { - return sortedCountries.size(); - } - - @Override - public int getCountForSection(int section) { - String n = sortedCountries.get(section); - ArrayList arr = countries.get(n); - return arr.size(); - } - - @Override - public View getItemView(int section, int position, View convertView, ViewGroup parent) { - if (convertView == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = li.inflate(R.layout.country_row_layout, parent, false); - } - TextView textView = (TextView)convertView.findViewById(R.id.settings_row_text); - TextView detailTextView = (TextView)convertView.findViewById(R.id.settings_row_text_detail); - View divider = convertView.findViewById(R.id.settings_row_divider); - - String n = sortedCountries.get(section); - ArrayList arr = countries.get(n); - Country c = arr.get(position); - textView.setText(c.name); - detailTextView.setText("+" + c.code); - if (position == arr.size() - 1) { - divider.setVisibility(View.GONE); - } else { - divider.setVisibility(View.VISIBLE); - } - - return convertView; - } - - @Override - public int getItemViewType(int section, int position) { - return 0; - } - - @Override - public int getItemViewTypeCount() { - return 1; - } - - @Override - public int getSectionHeaderViewType(int section) { - return 0; - } - - @Override - public int getSectionHeaderViewTypeCount() { - return 1; - } - - @Override - public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { - if (convertView == null) { - convertView = new SettingsSectionLayout(mContext); - convertView.setBackgroundColor(0xfffafafa); - } - ((SettingsSectionLayout) convertView).setText(sortedCountries.get(section).toUpperCase()); - return convertView; - } - } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java index d3788938..ca5d47f5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java @@ -29,11 +29,11 @@ import org.telegram.android.LocaleController; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import java.io.BufferedReader; import java.io.File; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java index 71b3f184..32c49b26 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java @@ -17,6 +17,7 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.text.Editable; +import android.text.InputType; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableStringBuilder; @@ -28,6 +29,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.inputmethod.EditorInfo; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.EditText; @@ -46,11 +48,11 @@ import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.ui.Adapters.BaseSectionsAdapter; -import org.telegram.ui.Adapters.ContactsActivityAdapter; -import org.telegram.ui.Adapters.ContactsActivitySearchAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.Adapters.ContactsAdapter; +import org.telegram.ui.Adapters.ContactsSearchAdapter; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SectionsListView; import java.util.ArrayList; @@ -87,7 +89,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen private TextView emptyTextView; private EditText userSelectEditText; private SectionsListView listView; - private ContactsActivitySearchAdapter searchListViewAdapter; + private ContactsSearchAdapter searchListViewAdapter; private int beforeChangeIndex; private int maxCount = 200; @@ -160,85 +162,17 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen TextView doneTextView = (TextView)doneItem.findViewById(R.id.done_button); doneTextView.setText(LocaleController.getString("Next", R.string.Next)); - searchListViewAdapter = new ContactsActivitySearchAdapter(getParentActivity(), null, false); - listViewAdapter = new ContactsActivityAdapter(getParentActivity(), true, false, null); - - /* - - - - - - - - - - ------------RTL---------- END - - - - - - */ + searchListViewAdapter = new ContactsSearchAdapter(getParentActivity(), null, false); + listViewAdapter = new ContactsAdapter(getParentActivity(), true, false, null); + searchListViewAdapter.setUseUserCell(true); fragmentView = new LinearLayout(getParentActivity()); LinearLayout linearLayout = (LinearLayout) fragmentView; linearLayout.setOrientation(LinearLayout.VERTICAL); - emptyTextView = new TextView(getParentActivity()); - emptyTextView.setTextColor(0xff808080); - emptyTextView.setTextSize(24); - emptyTextView.setGravity(Gravity.CENTER); - emptyTextView.setVisibility(View.INVISIBLE); - emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); - linearLayout.addView(emptyTextView); - LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) emptyTextView.getLayoutParams(); - layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; - layoutParams.height = LinearLayout.LayoutParams.MATCH_PARENT; - layoutParams.gravity = Gravity.TOP; - emptyTextView.setLayoutParams(layoutParams); - emptyTextView.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent event) { - return true; - } - }); - FrameLayout frameLayout = new FrameLayout(getParentActivity()); linearLayout.addView(frameLayout); - layoutParams = (LinearLayout.LayoutParams) frameLayout.getLayoutParams(); + LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) frameLayout.getLayoutParams(); layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; layoutParams.height = LinearLayout.LayoutParams.WRAP_CONTENT; layoutParams.gravity = Gravity.TOP; @@ -246,7 +180,23 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen userSelectEditText = new EditText(getParentActivity()); userSelectEditText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + userSelectEditText.setHintTextColor(0xffa6a6a6); + userSelectEditText.setTextColor(0xff000000); + userSelectEditText.setMinimumHeight(AndroidUtilities.dp(52)); + userSelectEditText.setMaxLines(2); + userSelectEditText.setPadding(userSelectEditText.getPaddingLeft(), AndroidUtilities.dp(3), userSelectEditText.getPaddingRight(), userSelectEditText.getPaddingBottom()); + userSelectEditText.setInputType(InputType.TYPE_TEXT_VARIATION_FILTER | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_MULTI_LINE); + userSelectEditText.setImeOptions(EditorInfo.IME_ACTION_DONE); + userSelectEditText.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + AndroidUtilities.clearCursorDrawable(userSelectEditText); frameLayout.addView(userSelectEditText); + FrameLayout.LayoutParams layoutParams1 = (FrameLayout.LayoutParams) userSelectEditText.getLayoutParams(); + layoutParams1.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.leftMargin = AndroidUtilities.dp(5); + layoutParams1.rightMargin = AndroidUtilities.dp(5); + layoutParams1.gravity = Gravity.TOP; + userSelectEditText.setLayoutParams(layoutParams1); userSelectEditText.setHint(LocaleController.getString("SendMessageTo", R.string.SendMessageTo)); if (Build.VERSION.SDK_INT >= 11) { @@ -301,24 +251,59 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen if (search) { String text = userSelectEditText.getText().toString().replace("<", ""); if (text.length() != 0) { - searchDialogs(text); searching = true; searchWas = true; - emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); - listViewAdapter.notifyDataSetChanged(); + if (listView != null) { + listView.setAdapter(searchListViewAdapter); + searchListViewAdapter.notifyDataSetChanged(); + if(android.os.Build.VERSION.SDK_INT >= 11) { + listView.setFastScrollAlwaysVisible(false); + } + listView.setFastScrollEnabled(false); + listView.setVerticalScrollBarEnabled(true); + } + if (emptyTextView != null) { + emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); + } + searchListViewAdapter.searchDialogs(text); } else { - searchResult = null; - searchResultNames = null; + searchListViewAdapter.searchDialogs(null); searching = false; searchWas = false; - emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); + ViewGroup group = (ViewGroup) listView.getParent(); + listView.setAdapter(listViewAdapter); listViewAdapter.notifyDataSetChanged(); + if (android.os.Build.VERSION.SDK_INT >= 11) { + listView.setFastScrollAlwaysVisible(true); + } + listView.setFastScrollEnabled(true); + listView.setVerticalScrollBarEnabled(false); + emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); } } } } }); + emptyTextView = new TextView(getParentActivity()); + emptyTextView.setTextColor(0xff808080); + emptyTextView.setTextSize(24); + emptyTextView.setGravity(Gravity.CENTER); + emptyTextView.setVisibility(View.INVISIBLE); + emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); + linearLayout.addView(emptyTextView); + layoutParams = (LinearLayout.LayoutParams) emptyTextView.getLayoutParams(); + layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = LinearLayout.LayoutParams.MATCH_PARENT; + layoutParams.gravity = Gravity.TOP; + emptyTextView.setLayoutParams(layoutParams); + emptyTextView.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + return true; + } + }); + listView = new SectionsListView(getParentActivity()); listView.setEmptyView(emptyTextView); listView.setVerticalScrollBarEnabled(false); @@ -331,7 +316,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen listView.setFastScrollAlwaysVisible(true); listView.setVerticalScrollbarPosition(LocaleController.isRTL ? ListView.SCROLLBAR_POSITION_LEFT : ListView.SCROLLBAR_POSITION_RIGHT); } - ((FrameLayout) fragmentView).addView(listView); + linearLayout.addView(listView); layoutParams = (LinearLayout.LayoutParams) listView.getLayoutParams(); layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; layoutParams.height = LinearLayout.LayoutParams.MATCH_PARENT; @@ -339,7 +324,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { - TLRPC.User user; + /*TLRPC.User user; int section = listViewAdapter.getSectionForPosition(i); int row = listViewAdapter.getPositionInSectionForPosition(i); if (searching && searchWas) { @@ -387,7 +372,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen listViewAdapter.notifyDataSetChanged(); } else { listView.invalidateViews(); - } + }*/ } }); listView.setOnScrollListener(new AbsListView.OnScrollListener() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 8187925c..336dbadf 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -8,7 +8,6 @@ package org.telegram.ui; -import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; @@ -18,7 +17,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; -import android.widget.ImageButton; +import android.widget.ListView; import android.widget.TextView; import org.telegram.android.AndroidUtilities; @@ -30,22 +29,20 @@ import org.telegram.messenger.FileLog; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; +import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.UserCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.AvatarUpdater; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.PinnedHeaderListView; -import org.telegram.ui.Views.SectionedBaseAdapter; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.ActionBar.BaseFragment; import java.util.ArrayList; import java.util.concurrent.Semaphore; public class GroupCreateFinalActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, AvatarUpdater.AvatarUpdaterDelegate { - private PinnedHeaderListView listView; + private ListView listView; private EditText nameTextView; private TLRPC.FileLocation avatar; private TLRPC.InputFile uploadedAvatar; @@ -185,11 +182,8 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati fragmentView = inflater.inflate(R.layout.group_create_final_layout, container, false); - final ImageButton button2 = (ImageButton)fragmentView.findViewById(R.id.settings_change_avatar_button); - if (isBroadcast) { - button2.setVisibility(View.GONE); - } else { - button2.setOnClickListener(new View.OnClickListener() { + if (!isBroadcast) { + /*button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (getParentActivity() == null) { @@ -221,7 +215,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati }); showAlertDialog(builder); } - }); + });*/ } avatarImage = (BackupImageView)fragmentView.findViewById(R.id.settings_avatar_image); @@ -238,7 +232,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati nameTextView.setText(nameToSet); nameToSet = null; } - listView = (PinnedHeaderListView)fragmentView.findViewById(R.id.listView); + listView = (ListView)fragmentView.findViewById(R.id.listView); listView.setAdapter(new ListAdapter(getParentActivity())); } else { ViewGroup parent = (ViewGroup)fragmentView.getParent(); @@ -346,18 +340,13 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati } } - private class ListAdapter extends SectionedBaseAdapter { + private class ListAdapter extends BaseFragmentAdapter { private Context mContext; public ListAdapter(Context context) { mContext = context; } - @Override - public Object getItem(int section, int position) { - return null; - } - @Override public boolean areAllItemsEnabled() { return false; @@ -369,61 +358,22 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati } @Override - public long getItemId(int section, int position) { - return 0; - } - - @Override - public int getSectionCount() { - return 1; - } - - @Override - public int getCountForSection(int section) { - if (selectedContacts == null) { - return 0; + public View getView(int i, View view, ViewGroup viewGroup) { + TLRPC.User user = MessagesController.getInstance().getUser(selectedContacts.get(i)); + if (view == null) { + view = new UserCell(mContext, 1); } - return selectedContacts.size(); - } + ((UserCell) view).setData(user, null, null, 0); + return view; - @Override - public View getItemView(int section, int position, View convertView, ViewGroup parent) { - TLRPC.User user = MessagesController.getInstance().getUser(selectedContacts.get(position)); - if (convertView == null) { - convertView = new UserCell(mContext, 1); - } - ((UserCell) convertView).setData(user, null, null, 0); - return convertView; - } - - @Override - public int getItemViewType(int section, int position) { - return 0; - } - - @Override - public int getItemViewTypeCount() { - return 1; - } - - @Override - public int getSectionHeaderViewType(int section) { - return 0; - } - - @Override - public int getSectionHeaderViewTypeCount() { - return 1; - } - - @Override - public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { + /* if (convertView == null) { convertView = new SettingsSectionLayout(mContext); convertView.setBackgroundColor(0xffffffff); } ((SettingsSectionLayout) convertView).setText(LocaleController.formatPluralString("Members", selectedContacts.size()).toUpperCase()); return convertView; + */ } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index ab436098..fdfc54f0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -26,8 +26,8 @@ import org.telegram.android.LocaleController; import org.telegram.messenger.TLRPC; import org.telegram.android.MessagesController; import org.telegram.messenger.R; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.IdenticonDrawable; public class IdenticonActivity extends BaseFragment { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java index f5365d32..a0fa16ec 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java @@ -11,6 +11,7 @@ package org.telegram.ui; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -18,6 +19,7 @@ import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.EditText; +import android.widget.FrameLayout; import android.widget.ListView; import android.widget.TextView; @@ -27,10 +29,11 @@ import org.telegram.android.LocaleController; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.Cells.TextSettingsCell; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.BaseFragment; import java.util.ArrayList; import java.util.Timer; @@ -50,6 +53,9 @@ public class LanguageSelectActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { + searching = false; + searchWas = false; + actionBar.setBackButtonImage(R.drawable.ic_ab_back); actionBar.setBackOverlay(R.layout.updating_state_layout); actionBar.setTitle(LocaleController.getString("Language", R.string.Language)); @@ -90,32 +96,46 @@ public class LanguageSelectActivity extends BaseFragment { if (listView != null) { listView.setPadding(AndroidUtilities.dp(16), listView.getPaddingTop(), AndroidUtilities.dp(16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); - if(android.os.Build.VERSION.SDK_INT >= 11) { - listView.setFastScrollAlwaysVisible(false); - } - listView.setFastScrollEnabled(false); - listView.setVerticalScrollBarEnabled(true); - } - if (emptyTextView != null) { - emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); } } } }); - fragmentView = inflater.inflate(R.layout.language_select_layout, container, false); listAdapter = new ListAdapter(getParentActivity()); - listView = (ListView)fragmentView.findViewById(R.id.listView); - listView.setAdapter(listAdapter); - emptyTextView = (TextView)fragmentView.findViewById(R.id.searchEmptyView); - listView.setEmptyView(emptyTextView); + searchListViewAdapter = new SearchAdapter(getParentActivity()); + + fragmentView = new FrameLayout(getParentActivity()); + + emptyTextView = new TextView(getParentActivity()); + emptyTextView.setTextColor(0xff808080); + emptyTextView.setTextSize(24); + emptyTextView.setGravity(Gravity.CENTER); + emptyTextView.setVisibility(View.INVISIBLE); + emptyTextView.setText(LocaleController.getString("NoResult", R.string.NoResult)); + ((FrameLayout) fragmentView).addView(emptyTextView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) emptyTextView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.gravity = Gravity.TOP; + emptyTextView.setLayoutParams(layoutParams); emptyTextView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); - searchListViewAdapter = new SearchAdapter(getParentActivity()); + + listView = new ListView(getParentActivity()); + listView.setEmptyView(emptyTextView); + listView.setVerticalScrollBarEnabled(false); + listView.setDivider(null); + listView.setDividerHeight(0); + listView.setAdapter(listAdapter); + ((FrameLayout) fragmentView).addView(listView); + layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(layoutParams); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override @@ -192,9 +212,6 @@ public class LanguageSelectActivity extends BaseFragment { public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) { } }); - - searching = false; - searchWas = false; } else { ViewGroup parent = (ViewGroup)fragmentView.getParent(); if (parent != null) { @@ -316,19 +333,11 @@ public class LanguageSelectActivity extends BaseFragment { @Override public View getView(int i, View view, ViewGroup viewGroup) { if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.settings_row_button_layout, viewGroup, false); + view = new TextSettingsCell(mContext); } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - View divider = view.findViewById(R.id.settings_row_divider); LocaleController.LocaleInfo c = searchResult.get(i); - textView.setText(c.name); - if (i == searchResult.size() - 1) { - divider.setVisibility(View.GONE); - } else { - divider.setVisibility(View.VISIBLE); - } + ((TextSettingsCell) view).setText(c.name, i != searchResult.size() - 1); return view; } @@ -392,19 +401,11 @@ public class LanguageSelectActivity extends BaseFragment { @Override public View getView(int i, View view, ViewGroup viewGroup) { if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.settings_row_button_layout, viewGroup, false); + view = new TextSettingsCell(mContext); } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - View divider = view.findViewById(R.id.settings_row_divider); LocaleController.LocaleInfo localeInfo = LocaleController.getInstance().sortedLanguages.get(i); - textView.setText(localeInfo.name); - if (i == LocaleController.getInstance().sortedLanguages.size() - 1) { - divider.setVisibility(View.GONE); - } else { - divider.setVisibility(View.VISIBLE); - } + ((TextSettingsCell) view).setText(localeInfo.name, i != LocaleController.getInstance().sortedLanguages.size() - 1); return view; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index f10eabec..4b00db4e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -50,9 +50,9 @@ import org.telegram.messenger.TLRPC; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.ui.Adapters.DrawerLayoutAdapter; -import org.telegram.ui.Views.ActionBar.ActionBarLayout; -import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.ActionBar.DrawerLayoutContainer; +import org.telegram.ui.ActionBar.ActionBarLayout; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.DrawerLayoutContainer; import java.io.BufferedReader; import java.io.InputStream; @@ -361,7 +361,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } } } else if (fragmentName.equals("wallpapers")) { - SettingsWallpapersActivity settings = new SettingsWallpapersActivity(); + WallpapersActivity settings = new WallpapersActivity(); actionBarLayout.addFragmentToStack(settings); settings.restoreSelfArgs(savedInstanceState); } @@ -1007,7 +1007,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } else if (lastFragment instanceof GroupCreateFinalActivity && args != null) { outState.putBundle("args", args); outState.putString("fragment", "group"); - } else if (lastFragment instanceof SettingsWallpapersActivity) { + } else if (lastFragment instanceof WallpapersActivity) { outState.putString("fragment", "wallpapers"); } else if (lastFragment instanceof ProfileActivity && ((ProfileActivity) lastFragment).isChat() && args != null) { outState.putBundle("args", args); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index 653b1471..8839b184 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -35,12 +35,12 @@ import org.telegram.android.MessageObject; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import java.util.List; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 6db5174c..a9cf6b42 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -27,9 +27,9 @@ import org.telegram.android.AndroidUtilities; import org.telegram.messenger.FileLog; import org.telegram.android.LocaleController; import org.telegram.messenger.R; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SlideView; import java.util.Map; @@ -42,10 +42,284 @@ public class LoginActivity extends BaseFragment implements SlideView.SlideViewDe private final static int done_button = 1; - @Override - public boolean onFragmentCreate() { - return super.onFragmentCreate(); - } + /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ @Override public void onFragmentDestroy() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java index a038fba8..2c504e4b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java @@ -31,7 +31,7 @@ import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.RPCRequest; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.SlideView; import java.io.BufferedReader; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java index 69df42d5..de8e586c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java @@ -33,9 +33,9 @@ import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBar; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import java.util.ArrayList; import java.util.HashMap; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index d0d0933c..96536d39 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -40,24 +40,24 @@ import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Adapters.MessagesActivityAdapter; -import org.telegram.ui.Adapters.MessagesActivitySearchAdapter; +import org.telegram.ui.Adapters.DialogsAdapter; +import org.telegram.ui.Adapters.DialogsSearchAdapter; import org.telegram.ui.AnimationCompat.ObjectAnimatorProxy; import org.telegram.ui.AnimationCompat.ViewProxy; import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Cells.DialogCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; -import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.ActionBar.MenuDrawable; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.MenuDrawable; import java.util.ArrayList; public class MessagesActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { private ListView messagesListView; - private MessagesActivityAdapter messagesActivityAdapter; - private MessagesActivitySearchAdapter messagesActivitySearchAdapter; + private DialogsAdapter dialogsAdapter; + private DialogsSearchAdapter dialogsSearchAdapter; private TextView searchEmptyView; private View progressView; private View emptyView; @@ -158,13 +158,13 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter ViewProxy.setTranslationY(floatingButton, AndroidUtilities.dp(100)); hideFloatingButton(false); } - if (messagesListView.getAdapter() != messagesActivityAdapter) { - messagesListView.setAdapter(messagesActivityAdapter); - messagesActivityAdapter.notifyDataSetChanged(); + if (messagesListView.getAdapter() != dialogsAdapter) { + messagesListView.setAdapter(dialogsAdapter); + dialogsAdapter.notifyDataSetChanged(); } } - if (messagesActivitySearchAdapter != null) { - messagesActivitySearchAdapter.searchDialogs(null, false); + if (dialogsSearchAdapter != null) { + dialogsSearchAdapter.searchDialogs(null, false); } } @@ -173,9 +173,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter String text = editText.getText().toString(); if (text.length() != 0) { searchWas = true; - if (messagesActivitySearchAdapter != null) { - messagesListView.setAdapter(messagesActivitySearchAdapter); - messagesActivitySearchAdapter.notifyDataSetChanged(); + if (dialogsSearchAdapter != null) { + messagesListView.setAdapter(dialogsSearchAdapter); + dialogsSearchAdapter.notifyDataSetChanged(); } if (searchEmptyView != null && messagesListView.getEmptyView() == emptyView) { messagesListView.setEmptyView(searchEmptyView); @@ -183,8 +183,8 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter progressView.setVisibility(View.GONE); } } - if (messagesActivitySearchAdapter != null) { - messagesActivitySearchAdapter.searchDialogs(text, serverOnly); + if (dialogsSearchAdapter != null) { + dialogsSearchAdapter.searchDialogs(text, serverOnly); } } }); @@ -215,9 +215,9 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter fragmentView = inflater.inflate(R.layout.messages_list, container, false); - messagesActivityAdapter = new MessagesActivityAdapter(getParentActivity(), serverOnly); - messagesActivitySearchAdapter = new MessagesActivitySearchAdapter(getParentActivity()); - messagesActivitySearchAdapter.setDelegate(new MessagesActivitySearchAdapter.MessagesActivitySearchAdapterDelegate() { + dialogsAdapter = new DialogsAdapter(getParentActivity(), serverOnly); + dialogsSearchAdapter = new DialogsSearchAdapter(getParentActivity()); + dialogsSearchAdapter.setDelegate(new DialogsSearchAdapter.MessagesActivitySearchAdapterDelegate() { @Override public void searchStateChanged(boolean search) { if (searching && searchWas && messagesListView != null) { @@ -229,13 +229,13 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter }); messagesListView = (ListView)fragmentView.findViewById(R.id.messages_list_view); - messagesListView.setAdapter(messagesActivityAdapter); + messagesListView.setAdapter(dialogsAdapter); if (Build.VERSION.SDK_INT >= 11) { messagesListView.setVerticalScrollbarPosition(LocaleController.isRTL ? ListView.SCROLLBAR_POSITION_LEFT : ListView.SCROLLBAR_POSITION_RIGHT); } progressView = fragmentView.findViewById(R.id.progressLayout); - messagesActivityAdapter.notifyDataSetChanged(); + dialogsAdapter.notifyDataSetChanged(); searchEmptyView = (TextView)fragmentView.findViewById(R.id.searchEmptyView); searchEmptyView.setOnTouchListener(new View.OnTouchListener() { @Override @@ -295,17 +295,17 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter long dialog_id = 0; int message_id = 0; BaseFragmentAdapter adapter = (BaseFragmentAdapter)messagesListView.getAdapter(); - if (adapter == messagesActivityAdapter) { - TLRPC.TL_dialog dialog = messagesActivityAdapter.getItem(i); + if (adapter == dialogsAdapter) { + TLRPC.TL_dialog dialog = dialogsAdapter.getItem(i); if (dialog == null) { return; } dialog_id = dialog.id; - } else if (adapter == messagesActivitySearchAdapter) { - Object obj = messagesActivitySearchAdapter.getItem(i); + } else if (adapter == dialogsSearchAdapter) { + Object obj = dialogsSearchAdapter.getItem(i); if (obj instanceof TLRPC.User) { dialog_id = ((TLRPC.User) obj).id; - if (messagesActivitySearchAdapter.isGlobalSearch(i)) { + if (dialogsSearchAdapter.isGlobalSearch(i)) { ArrayList users = new ArrayList(); users.add((TLRPC.User)obj); MessagesController.getInstance().putUsers(users, false); @@ -356,7 +356,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter if (openedDialogId == dialog_id) { return; } - messagesActivityAdapter.setOpenedDialogId(openedDialogId = dialog_id); + dialogsAdapter.setOpenedDialogId(openedDialogId = dialog_id); updateVisibleRows(MessagesController.UPDATE_MASK_SELECT_DIALOG); } presentFragment(new ChatActivity(args)); @@ -501,11 +501,11 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter @Override public void onResume() { super.onResume(); - if (messagesActivityAdapter != null) { - messagesActivityAdapter.notifyDataSetChanged(); + if (dialogsAdapter != null) { + dialogsAdapter.notifyDataSetChanged(); } - if (messagesActivitySearchAdapter != null) { - messagesActivitySearchAdapter.notifyDataSetChanged(); + if (dialogsSearchAdapter != null) { + dialogsSearchAdapter.notifyDataSetChanged(); } } @@ -533,8 +533,8 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter @SuppressWarnings("unchecked") public void didReceivedNotification(int id, Object... args) { if (id == NotificationCenter.dialogsNeedReload) { - if (messagesActivityAdapter != null) { - messagesActivityAdapter.notifyDataSetChanged(); + if (dialogsAdapter != null) { + dialogsAdapter.notifyDataSetChanged(); } if (messagesListView != null) { if (MessagesController.getInstance().loadingDialogs && MessagesController.getInstance().dialogs.isEmpty()) { @@ -577,7 +577,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } else { openedDialogId = dialog_id; } - messagesActivityAdapter.setOpenedDialogId(openedDialogId); + dialogsAdapter.setOpenedDialogId(openedDialogId); updateVisibleRows(MessagesController.UPDATE_MASK_SELECT_DIALOG); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java similarity index 99% rename from TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java index 7ac17301..d9dceac9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/NotificationsSettingsActivity.java @@ -43,12 +43,12 @@ import org.telegram.ui.Cells.ShadowSectionCell; import org.telegram.ui.Cells.TextCheckCell; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextDetailSettingsCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.ColorPickerView; -public class SettingsNotificationsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { +public class NotificationsSettingsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { private ListView listView; private boolean reseting = false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java index df151897..6fcad48a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java @@ -20,16 +20,16 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.FrameLayout; -import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.ImageLoader; import org.telegram.messenger.FileLog; import org.telegram.android.LocaleController; import org.telegram.messenger.R; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import java.io.File; @@ -282,6 +282,8 @@ public class PhotoCropActivity extends BaseFragment { private boolean sameBitmap = false; private boolean doneButtonPressed = false; + private final static int done_button = 1; + public PhotoCropActivity(Bundle args) { super(args); } @@ -328,33 +330,30 @@ public class PhotoCropActivity extends BaseFragment { @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + actionBar.setTitle(LocaleController.getString("AddContact", R.string.AddContact)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - View doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (delegate != null && !doneButtonPressed) { - Bitmap bitmap = view.getBitmap(); - if (bitmap == imageToCrop) { - sameBitmap = true; + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } else if (id == done_button) { + if (delegate != null && !doneButtonPressed) { + Bitmap bitmap = view.getBitmap(); + if (bitmap == imageToCrop) { + sameBitmap = true; + } + delegate.didFinishCrop(bitmap); + doneButtonPressed = true; } - delegate.didFinishCrop(bitmap); - doneButtonPressed = true; + finishFragment(); } - finishFragment(); } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + menu.addItem(done_button, R.drawable.ic_done); fragmentView = view = new PhotoCropView(getParentActivity()); fragmentView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java index 56da3ea1..1d28303b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoPickerActivity.java @@ -32,9 +32,9 @@ import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.android.MessageObject; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.BackupImageView; import java.util.ArrayList; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index 1e22d13b..7235b98a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -63,9 +63,9 @@ import org.telegram.ui.AnimationCompat.AnimatorListenerAdapterProxy; import org.telegram.ui.AnimationCompat.AnimatorSetProxy; import org.telegram.ui.AnimationCompat.ObjectAnimatorProxy; import org.telegram.ui.AnimationCompat.ViewProxy; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.ClippingImageView; import org.telegram.android.ImageReceiver; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PopupNotificationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PopupNotificationActivity.java index 90201f2d..0d40b8db 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PopupNotificationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PopupNotificationActivity.java @@ -44,8 +44,8 @@ import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; import org.telegram.android.MessageObject; import org.telegram.android.PhotoObject; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.BackupImageView; import org.telegram.ui.Views.ChatActivityEnterView; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 223eb110..2f4d945b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -54,13 +54,13 @@ import org.telegram.ui.Cells.ShadowSectionCell; import org.telegram.ui.Cells.TextCell; import org.telegram.ui.Cells.TextDetailCell; import org.telegram.ui.Cells.UserCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.AvatarUpdater; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.IdenticonDrawable; import java.util.ArrayList; @@ -325,7 +325,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. } else if (id == edit_name) { Bundle args = new Bundle(); args.putInt("chat_id", chat_id); - presentFragment(new ChatProfileChangeNameActivity(args)); + presentFragment(new ChangeChatNameActivity(args)); } } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java index cda48c60..22e09d19 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java @@ -40,8 +40,8 @@ import org.telegram.messenger.TLRPC; import org.telegram.ui.Adapters.BaseFragmentAdapter; import org.telegram.ui.Cells.TextColorCell; import org.telegram.ui.Cells.TextDetailSettingsCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.ColorPickerView; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index 9b573d9f..070e3e86 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -69,13 +69,13 @@ import org.telegram.ui.Cells.ShadowSectionCell; import org.telegram.ui.Cells.TextCheckCell; import org.telegram.ui.Cells.TextDetailSettingsCell; import org.telegram.ui.Cells.TextSettingsCell; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.AvatarUpdater; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.NumberPicker; import java.io.File; @@ -274,7 +274,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter if (id == -1) { finishFragment(); } else if (id == edit_name) { - presentFragment(new SettingsChangeNameActivity()); + presentFragment(new ChangeNameActivity()); } else if (id == logout) { if (getParentActivity() == null) { return; @@ -424,11 +424,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter listView.invalidateViews(); } } else if (i == notificationRow) { - presentFragment(new SettingsNotificationsActivity()); + presentFragment(new NotificationsSettingsActivity()); } else if (i == blockedRow) { - presentFragment(new SettingsBlockedUsersActivity()); + presentFragment(new BlockedUsersActivity()); } else if (i == backgroundRow) { - presentFragment(new SettingsWallpapersActivity()); + presentFragment(new WallpapersActivity()); } else if (i == askQuestionRow) { if (getParentActivity() == null) { return; @@ -627,7 +627,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter builder.setNegativeButton(LocaleController.getString("OK", R.string.OK), null); showAlertDialog(builder); } else if (i == usernameRow) { - presentFragment(new SettingsChangeUsernameActivity()); + presentFragment(new ChangeUsernameActivity()); } } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java index c1cac76c..35a5cd43 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/VideoEditorActivity.java @@ -46,9 +46,9 @@ import org.telegram.android.MediaController; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; -import org.telegram.ui.Views.ActionBar.ActionBar; -import org.telegram.ui.Views.ActionBar.ActionBarMenu; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.VideoSeekBarView; import org.telegram.ui.Views.VideoTimelineView; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java index 7eafab4c..9f7e5ccf 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java @@ -25,7 +25,7 @@ import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.ui.LaunchActivity; import org.telegram.ui.PhotoCropActivity; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import java.io.File; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/PinnedHeaderListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/PinnedHeaderListView.java deleted file mode 100755 index 6d31c0b4..00000000 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/PinnedHeaderListView.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * This is the source code of Telegram for Android v. 1.3.2. - * It is licensed under GNU GPL v. 2 or later. - * You should have received a copy of the license in this archive (see LICENSE). - * - * Copyright Nikolai Kudashov, 2013. - */ - -package org.telegram.ui.Views; - -import android.content.Context; -import android.graphics.Canvas; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.View; -import android.view.ViewGroup; -import android.widget.*; -import android.widget.AbsListView.OnScrollListener; - -import org.telegram.messenger.FileLog; - -public class PinnedHeaderListView extends ListView implements OnScrollListener, View.OnTouchListener { - - private OnScrollListener mOnScrollListener; - - public static interface PinnedSectionedHeaderAdapter { - public boolean isSectionHeader(int position); - - public int getSectionForPosition(int position); - - public View getSectionHeaderView(int section, View convertView, ViewGroup parent); - - public int getSectionHeaderViewType(int section); - - public int getCount(); - - } - - private PinnedSectionedHeaderAdapter mAdapter; - private OnTouchListener mForwardingTouchListener = null; - private float mLastUpEventY = -1; - private View mCurrentHeader; - private int mCurrentHeaderViewType = 0; - private float mHeaderOffset; - private boolean mShouldPin = true; - private int mCurrentSection = 0; - private int mWidthMode; - public int exHeaderRightPadding = 0; - - public PinnedHeaderListView(Context context) { - super(context); - super.setOnScrollListener(this); - super.setOnTouchListener(this); - } - - public PinnedHeaderListView(Context context, AttributeSet attrs) { - super(context, attrs); - super.setOnScrollListener(this); - super.setOnTouchListener(this); - } - - public PinnedHeaderListView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - super.setOnScrollListener(this); - super.setOnTouchListener(this); - } - - public void setPinHeaders(boolean shouldPin) { - mShouldPin = shouldPin; - } - - @Override - public void setAdapter(ListAdapter adapter) { - if (mAdapter == adapter) { - return; - } - mCurrentHeader = null; - if (adapter instanceof PinnedSectionedHeaderAdapter) { - mAdapter = (PinnedSectionedHeaderAdapter) adapter; - } else { - mAdapter = null; - } - super.setAdapter(adapter); - } - - @Override - public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { - if (mOnScrollListener != null) { - mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); - } - if (mAdapter == null) { - return; - } - - if (mAdapter.getCount() == 0 || !mShouldPin || (firstVisibleItem < getHeaderViewsCount())) { - mCurrentHeader = null; - mHeaderOffset = 0.0f; - for (int i = firstVisibleItem; i < firstVisibleItem + visibleItemCount; i++) { - View header = getChildAt(i); - if (header != null) { - header.setVisibility(VISIBLE); - } - } - return; - } - - firstVisibleItem -= getHeaderViewsCount(); - - int section = mAdapter.getSectionForPosition(firstVisibleItem); - int viewType = mAdapter.getSectionHeaderViewType(section); - mCurrentHeader = getSectionHeaderView(section, mCurrentHeaderViewType != viewType ? null : mCurrentHeader); - if (mCurrentHeader != null && mCurrentHeader.getPaddingLeft() != getPaddingLeft()) { - mCurrentHeader.setPadding(getPaddingLeft(), mCurrentHeader.getPaddingTop(), getPaddingRight() + (int)(getResources().getDisplayMetrics().density * exHeaderRightPadding), 0); - } - ensurePinnedHeaderLayout(mCurrentHeader, false); - mCurrentHeaderViewType = viewType; - - mHeaderOffset = 0.0f; - - for (int i = firstVisibleItem; i < firstVisibleItem + visibleItemCount; i++) { - if (mAdapter.isSectionHeader(i)) { - View header = getChildAt(i - firstVisibleItem); - float headerTop = header.getTop(); - float pinnedHeaderHeight = mCurrentHeader.getMeasuredHeight(); - header.setVisibility(VISIBLE); - if (pinnedHeaderHeight >= headerTop && headerTop > -1) { - mHeaderOffset = headerTop - header.getHeight(); - } else if (headerTop <= 0) { - header.setVisibility(INVISIBLE); - } - } - } - - invalidate(); - } - - @Override - public void onScrollStateChanged(AbsListView view, int scrollState) { - if (mOnScrollListener != null) { - mOnScrollListener.onScrollStateChanged(view, scrollState); - } - } - - private View getSectionHeaderView(int section, View oldView) { - boolean shouldLayout = section != mCurrentSection || oldView == null; - - View view = mAdapter.getSectionHeaderView(section, oldView, this); - if (shouldLayout) { - // a new section, thus a new header. We should lay it out again - ensurePinnedHeaderLayout(view, false); - mCurrentSection = section; - } - return view; - } - - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); - if (mAdapter == null) { - return; - } - if (mCurrentHeader != null) { - ensurePinnedHeaderLayout(mCurrentHeader, true); - } - } - - private void ensurePinnedHeaderLayout(View header, boolean forceLayout) { - if (header.isLayoutRequested() || forceLayout) { - int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), mWidthMode); - - int heightSpec; - ViewGroup.LayoutParams layoutParams = header.getLayoutParams(); - if (layoutParams != null && layoutParams.height > 0) { - heightSpec = MeasureSpec.makeMeasureSpec(layoutParams.height, MeasureSpec.EXACTLY); - } else { - heightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); - } - try { - header.measure(widthSpec, heightSpec); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - header.layout(0, 0, header.getMeasuredWidth(), header.getMeasuredHeight()); - } - } - - @Override - protected void dispatchDraw(Canvas canvas) { - super.dispatchDraw(canvas); - if (mAdapter == null || !mShouldPin || mCurrentHeader == null) { - return; - } - int saveCount = canvas.save(); - canvas.translate(0, mHeaderOffset); - canvas.clipRect(0, 0, getWidth(), mCurrentHeader.getMeasuredHeight()); // needed for < HONEYCOMB - mCurrentHeader.draw(canvas); - canvas.restoreToCount(saveCount); - } - - @Override - public boolean performItemClick(View view, int position, long id) { - if (mAdapter != null && mLastUpEventY > 0 && mCurrentHeader != null && mLastUpEventY < mCurrentHeader.getBottom()) { - mCurrentHeader.performClick(); - mLastUpEventY = -1; - return true; - } - return super.performItemClick(view, position, id); - } - - @Override - public void setOnTouchListener(OnTouchListener l) { - mForwardingTouchListener = l; - } - - @Override - public boolean onTouch(View v, MotionEvent event) { - if (mForwardingTouchListener != null) { - mForwardingTouchListener.onTouch(v, event); - } - - if (mCurrentHeader != null && event.getY() < mCurrentHeader.getHeight()) { - if (event.getAction() == MotionEvent.ACTION_UP) { - mLastUpEventY = event.getY(); - } - } - return false; - } - - @Override - public void setOnScrollListener(OnScrollListener l) { - mOnScrollListener = l; - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - mWidthMode = MeasureSpec.getMode(widthMeasureSpec); - } - - public void setOnItemClickListener(PinnedHeaderListView.OnItemClickListener listener) { - super.setOnItemClickListener(listener); - } - - public static abstract class OnItemClickListener implements AdapterView.OnItemClickListener { - @Override - public void onItemClick(AdapterView adapterView, View view, int rawPosition, long id) { - SectionedBaseAdapter adapter; - if (adapterView.getAdapter() instanceof HeaderViewListAdapter) { - HeaderViewListAdapter wrapperAdapter = (HeaderViewListAdapter) adapterView.getAdapter(); - adapter = (SectionedBaseAdapter) wrapperAdapter.getWrappedAdapter(); - } else { - adapter = (SectionedBaseAdapter) adapterView.getAdapter(); - } - int section = adapter.getSectionForPosition(rawPosition); - int position = adapter.getPositionInSectionForPosition(rawPosition); - - if (position == -1) { - onSectionClick(adapterView, view, section, id); - } else { - onItemClick(adapterView, view, section, position, id); - } - } - - public abstract void onItemClick(AdapterView adapterView, View view, int section, int position, long id); - - public abstract void onSectionClick(AdapterView adapterView, View view, int section, long id); - - } -} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java deleted file mode 100755 index 5cfa5f3e..00000000 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * This is the source code of Telegram for Android v. 1.3.2. - * It is licensed under GNU GPL v. 2 or later. - * You should have received a copy of the license in this archive (see LICENSE). - * - * Copyright Nikolai Kudashov, 2013. - */ - -package org.telegram.ui.Views; - -import android.util.SparseArray; -import android.view.View; -import android.view.ViewGroup; - -import org.telegram.ui.Adapters.BaseFragmentAdapter; - -public abstract class SectionedBaseAdapter extends BaseFragmentAdapter implements PinnedHeaderListView.PinnedSectionedHeaderAdapter { - - /** - * Holds the calculated values of @{link getPositionInSectionForPosition} - */ - private SparseArray mSectionPositionCache; - /** - * Holds the calculated values of @{link getSectionForPosition} - */ - private SparseArray mSectionCache; - /** - * Holds the calculated values of @{link getCountForSection} - */ - private SparseArray mSectionCountCache; - - /** - * Caches the item count - */ - private int mCount; - /** - * Caches the section count - */ - private int mSectionCount; - - public SectionedBaseAdapter() { - super(); - mSectionCache = new SparseArray(); - mSectionPositionCache = new SparseArray(); - mSectionCountCache = new SparseArray(); - mCount = -1; - mSectionCount = -1; - } - - @Override - public void notifyDataSetChanged() { - mSectionCache.clear(); - mSectionPositionCache.clear(); - mSectionCountCache.clear(); - mCount = -1; - mSectionCount = -1; - super.notifyDataSetChanged(); - } - - @Override - public void notifyDataSetInvalidated() { - mSectionCache.clear(); - mSectionPositionCache.clear(); - mSectionCountCache.clear(); - mCount = -1; - mSectionCount = -1; - super.notifyDataSetInvalidated(); - } - - @Override - public boolean areAllItemsEnabled() { - return false; - } - - @Override - public boolean isEnabled(int position) { - return !isSectionHeader(position); - } - - @Override - public final int getCount() { - if (mCount >= 0) { - return mCount; - } - int count = 0; - for (int i = 0; i < internalGetSectionCount(); i++) { - count += internalGetCountForSection(i); - count++; - } - mCount = count; - return count; - } - - @Override - public final Object getItem(int position) { - return getItem(getSectionForPosition(position), getPositionInSectionForPosition(position)); - } - - @Override - public final long getItemId(int position) { - return getItemId(getSectionForPosition(position), getPositionInSectionForPosition(position)); - } - - @Override - public final View getView(int position, View convertView, ViewGroup parent) { - if (isSectionHeader(position)) { - return getSectionHeaderView(getSectionForPosition(position), convertView, parent); - } - return getItemView(getSectionForPosition(position), getPositionInSectionForPosition(position), convertView, parent); - } - - @Override - public final int getItemViewType(int position) { - if (isSectionHeader(position)) { - return getItemViewTypeCount() + getSectionHeaderViewType(getSectionForPosition(position)); - } - return getItemViewType(getSectionForPosition(position), getPositionInSectionForPosition(position)); - } - - @Override - public final int getViewTypeCount() { - return getItemViewTypeCount() + getSectionHeaderViewTypeCount(); - } - - public final int getSectionForPosition(int position) { - // first try to retrieve values from cache - Integer cachedSection = mSectionCache.get(position); - if (cachedSection != null) { - return cachedSection; - } - int sectionStart = 0; - for (int i = 0; i < internalGetSectionCount(); i++) { - int sectionCount = internalGetCountForSection(i); - int sectionEnd = sectionStart + sectionCount + 1; - if (position >= sectionStart && position < sectionEnd) { - mSectionCache.put(position, i); - return i; - } - sectionStart = sectionEnd; - } - return 0; - } - - public int getPositionInSectionForPosition(int position) { - if (position == 0) { - position = 1; - } - // first try to retrieve values from cache - Integer cachedPosition = mSectionPositionCache.get(position); - if (cachedPosition != null) { - return cachedPosition; - } - int sectionStart = 0; - for (int i = 0; i < internalGetSectionCount(); i++) { - int sectionCount = internalGetCountForSection(i); - int sectionEnd = sectionStart + sectionCount + 1; - if (position >= sectionStart && position < sectionEnd) { - int positionInSection = position - sectionStart - 1; - mSectionPositionCache.put(position, positionInSection); - return positionInSection; - } - sectionStart = sectionEnd; - } - return 0; - } - - public final boolean isSectionHeader(int position) { - int sectionStart = 0; - for (int i = 0; i < internalGetSectionCount(); i++) { - if (position == sectionStart) { - return true; - } else if (position < sectionStart) { - return false; - } - sectionStart += internalGetCountForSection(i) + 1; - } - return false; - } - - public int getItemViewType(int section, int position) { - return 0; - } - - public int getItemViewTypeCount() { - return 1; - } - - public int getSectionHeaderViewType(int section) { - return 0; - } - - public int getSectionHeaderViewTypeCount() { - return 1; - } - - public abstract Object getItem(int section, int position); - - public abstract long getItemId(int section, int position); - - public abstract int getSectionCount(); - - public abstract int getCountForSection(int section); - - public abstract View getItemView(int section, int position, View convertView, ViewGroup parent); - - public abstract View getSectionHeaderView(int section, View convertView, ViewGroup parent); - - private int internalGetCountForSection(int section) { - Integer cachedSectionCount = mSectionCountCache.get(section); - if (cachedSectionCount != null) { - return cachedSectionCount; - } - int sectionCount = getCountForSection(section); - mSectionCountCache.put(section, sectionCount); - return sectionCount; - } - - private int internalGetSectionCount() { - if (mSectionCount >= 0) { - return mSectionCount; - } - mSectionCount = getSectionCount(); - return mSectionCount; - } -} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java index d2ee0169..ea1d1140 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java @@ -14,7 +14,6 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; -import android.widget.AdapterView; import android.widget.ListAdapter; import android.widget.ListView; @@ -200,16 +199,4 @@ public class SectionsListView extends ListView implements AbsListView.OnScrollLi public void setOnItemClickListener(SectionsListView.OnItemClickListener listener) { super.setOnItemClickListener(listener); } - - public static abstract class OnItemClickListener implements AdapterView.OnItemClickListener { - @Override - public void onItemClick(AdapterView adapterView, View view, int rawPosition, long id) { - SectionedBaseAdapter adapter = (SectionedBaseAdapter) adapterView.getAdapter(); - int section = adapter.getSectionForPosition(rawPosition); - int position = adapter.getPositionInSectionForPosition(rawPosition); - onItemClick(adapterView, view, section, position, id); - } - - public abstract void onItemClick(AdapterView adapterView, View view, int section, int position, long id); - } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java index 0cf3ead5..7e1f1a56 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java @@ -360,7 +360,6 @@ public class Switch extends CompoundButton { final float targetPosition = newCheckedState ? 1 : 0; mPositionAnimator = ObjectAnimatorProxy.ofFloatProxy(this, "thumbPosition", targetPosition); mPositionAnimator.setDuration(THUMB_ANIMATION_DURATION); - mPositionAnimator.setAutoCancel(true); mPositionAnimator.start(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/WallpapersActivity.java similarity index 86% rename from TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/WallpapersActivity.java index e3a80113..eae6cd10 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/WallpapersActivity.java @@ -26,10 +26,8 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.AdapterView; -import android.widget.Button; import android.widget.ImageView; import android.widget.ProgressBar; -import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.ImageLoader; @@ -45,8 +43,10 @@ import org.telegram.messenger.R; import org.telegram.messenger.RPCRequest; import org.telegram.messenger.Utilities; import org.telegram.ui.Adapters.BaseFragmentAdapter; +import org.telegram.ui.ActionBar.ActionBar; +import org.telegram.ui.ActionBar.ActionBarMenu; import org.telegram.ui.Views.BackupImageView; -import org.telegram.ui.Views.ActionBar.BaseFragment; +import org.telegram.ui.ActionBar.BaseFragment; import org.telegram.ui.Views.HorizontalListView; import java.io.File; @@ -54,7 +54,8 @@ import java.io.FileOutputStream; import java.util.ArrayList; import java.util.HashMap; -public class SettingsWallpapersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { +public class WallpapersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { + private HorizontalListView listView; private ListAdapter listAdapter; private ImageView backgroundImage; @@ -69,6 +70,8 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica private TLRPC.PhotoSize loadingSize = null; private String currentPicturePath; + private final static int done_button = 1; + @Override public boolean onFragmentCreate() { super.onFragmentCreate(); @@ -99,63 +102,60 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { - actionBar.setCustomView(R.layout.settings_do_action_layout); - Button cancelButton = (Button) actionBar.findViewById(R.id.cancel_button); - cancelButton.setOnClickListener(new View.OnClickListener() { + actionBar.setBackButtonImage(R.drawable.ic_ab_back); + actionBar.setBackOverlay(R.layout.updating_state_layout); + actionBar.setTitle(LocaleController.getString("ChatBackground", R.string.ChatBackground)); + actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override - public void onClick(View view) { - finishFragment(); - } - }); - doneButton = actionBar.findViewById(R.id.done_button); - doneButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - boolean done; - TLRPC.WallPaper wallPaper = wallpappersByIds.get(selectedBackground); - if (wallPaper != null && wallPaper.id != 1000001 && wallPaper instanceof TLRPC.TL_wallPaper) { - int width = AndroidUtilities.displaySize.x; - int height = AndroidUtilities.displaySize.y; - if (width > height) { - int temp = width; - width = height; - height = temp; - } - TLRPC.PhotoSize size = FileLoader.getClosestPhotoSizeWithSize(wallPaper.sizes, Math.min(width, height)); - String fileName = size.location.volume_id + "_" + size.location.local_id + ".jpg"; - File f = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName); - File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); - try { - done = Utilities.copyFile(f, toFile); - } catch (Exception e) { - done = false; - FileLog.e("tmessages", e); - } - } else { - if (selectedBackground == -1) { - File fromFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper-temp.jpg"); + public void onItemClick(int id) { + if (id == -1) { + finishFragment(); + } else if (id == done_button) { + boolean done; + TLRPC.WallPaper wallPaper = wallpappersByIds.get(selectedBackground); + if (wallPaper != null && wallPaper.id != 1000001 && wallPaper instanceof TLRPC.TL_wallPaper) { + int width = AndroidUtilities.displaySize.x; + int height = AndroidUtilities.displaySize.y; + if (width > height) { + int temp = width; + width = height; + height = temp; + } + TLRPC.PhotoSize size = FileLoader.getClosestPhotoSizeWithSize(wallPaper.sizes, Math.min(width, height)); + String fileName = size.location.volume_id + "_" + size.location.local_id + ".jpg"; + File f = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), fileName); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); - done = fromFile.renameTo(toFile); + try { + done = Utilities.copyFile(f, toFile); + } catch (Exception e) { + done = false; + FileLog.e("tmessages", e); + } } else { - done = true; + if (selectedBackground == -1) { + File fromFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper-temp.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); + done = fromFile.renameTo(toFile); + } else { + done = true; + } } - } - if (done) { - SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - SharedPreferences.Editor editor = preferences.edit(); - editor.putInt("selectedBackground", selectedBackground); - editor.putInt("selectedColor", selectedColor); - editor.commit(); - ApplicationLoader.cachedWallpaper = null; + if (done) { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("selectedBackground", selectedBackground); + editor.putInt("selectedColor", selectedColor); + editor.commit(); + ApplicationLoader.cachedWallpaper = null; + } + finishFragment(); } - finishFragment(); } }); - cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase()); - TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text); - textView.setText(LocaleController.getString("Set", R.string.Set).toUpperCase()); + ActionBarMenu menu = actionBar.createMenu(); + doneButton = menu.addItem(done_button, R.drawable.ic_done); fragmentView = inflater.inflate(R.layout.settings_wallpapers_layout, container, false); listAdapter = new ListAdapter(getParentActivity()); diff --git a/TMessagesProj/src/main/res/drawable-hdpi/addmember.png b/TMessagesProj/src/main/res/drawable-hdpi/addmember.png deleted file mode 100755 index 73dbd9db..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/addmember.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/btn_check_off_holo_light.png b/TMessagesProj/src/main/res/drawable-hdpi/btn_check_off_holo_light.png deleted file mode 100644 index 748c39be..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/btn_check_off_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/btn_check_on_holo_light.png b/TMessagesProj/src/main/res/drawable-hdpi/btn_check_on_holo_light.png deleted file mode 100644 index 00657d87..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/btn_check_on_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/btn_down.9.png b/TMessagesProj/src/main/res/drawable-hdpi/btn_down.9.png deleted file mode 100644 index cf2fb9fa..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/btn_down.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/btn_up.9.png b/TMessagesProj/src/main/res/drawable-hdpi/btn_up.9.png deleted file mode 100644 index 687f975e..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/btn_up.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_share.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_share.png deleted file mode 100644 index 961fa545..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_share.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_auth_next.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_auth_next.png deleted file mode 100644 index 1ce54e2f..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_auth_next.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_done.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_done.png old mode 100644 new mode 100755 index a62a06db..f42a0e2d Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_done.png and b/TMessagesProj/src/main/res/drawable-hdpi/ic_done.png differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_edit.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_edit.png deleted file mode 100644 index df231b32..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_edit.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_lock_blue.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_lock_blue.png deleted file mode 100644 index 9d181e14..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_lock_blue.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_msg_in_cross.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_msg_in_cross.png deleted file mode 100644 index cf625a21..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_msg_in_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_profile_cross.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_profile_cross.png deleted file mode 100644 index 5bf2732b..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/ic_profile_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/photo_edit_spinner.png b/TMessagesProj/src/main/res/drawable-hdpi/photo_edit_spinner.png deleted file mode 100644 index 160a1d3a..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/photo_edit_spinner.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_normal.9.png b/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_normal.9.png deleted file mode 100644 index fedd8275..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_normal.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_pressed.9.png b/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_pressed.9.png deleted file mode 100644 index 91099f3d..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/photo_spinner_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/search_light.9.png b/TMessagesProj/src/main/res/drawable-hdpi/search_light.9.png deleted file mode 100755 index 36e71d85..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/search_light.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/search_light_activated.9.png b/TMessagesProj/src/main/res/drawable-hdpi/search_light_activated.9.png new file mode 100644 index 00000000..b8d54c87 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-hdpi/search_light_activated.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/search_light_selected.9.png b/TMessagesProj/src/main/res/drawable-hdpi/search_light_selected.9.png deleted file mode 100755 index 72185bed..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/search_light_selected.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/switch_off1.png b/TMessagesProj/src/main/res/drawable-hdpi/switch_off1.png deleted file mode 100755 index c7188b84..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/switch_off1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/switch_off1_pressed.png b/TMessagesProj/src/main/res/drawable-hdpi/switch_off1_pressed.png deleted file mode 100644 index 3e96b22b..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/switch_off1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/switch_on1.png b/TMessagesProj/src/main/res/drawable-hdpi/switch_on1.png deleted file mode 100755 index f5b18f14..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/switch_on1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/switch_on1_pressed.png b/TMessagesProj/src/main/res/drawable-hdpi/switch_on1_pressed.png deleted file mode 100644 index c2f9c5b2..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/switch_on1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/textfield_activated.9.png b/TMessagesProj/src/main/res/drawable-hdpi/textfield_activated.9.png deleted file mode 100644 index 98ba91f8..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/textfield_activated.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/textfield_default.9.png b/TMessagesProj/src/main/res/drawable-hdpi/textfield_default.9.png deleted file mode 100644 index 5841e05b..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/textfield_default.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled.9.png b/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled.9.png deleted file mode 100644 index d7f78ab7..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled2.9.png b/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled2.9.png deleted file mode 100644 index 312a0f48..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/textfield_disabled2.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/textfield_focused.9.png b/TMessagesProj/src/main/res/drawable-hdpi/textfield_focused.9.png deleted file mode 100644 index 5fb8f7ee..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/textfield_focused.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/user_placeholder.png b/TMessagesProj/src/main/res/drawable-hdpi/user_placeholder.png deleted file mode 100644 index a1c989df..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/user_placeholder.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/viewbtn.9.png b/TMessagesProj/src/main/res/drawable-hdpi/viewbtn.9.png deleted file mode 100644 index a1e86f93..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/viewbtn.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-hdpi/viewbtn_pressed.9.png b/TMessagesProj/src/main/res/drawable-hdpi/viewbtn_pressed.9.png deleted file mode 100644 index 95e11730..00000000 Binary files a/TMessagesProj/src/main/res/drawable-hdpi/viewbtn_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/addmember.png b/TMessagesProj/src/main/res/drawable-mdpi/addmember.png deleted file mode 100755 index c23e2ff0..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/addmember.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/btn_check_off_holo_light.png b/TMessagesProj/src/main/res/drawable-mdpi/btn_check_off_holo_light.png deleted file mode 100644 index 34ebe308..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/btn_check_off_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/btn_check_on_holo_light.png b/TMessagesProj/src/main/res/drawable-mdpi/btn_check_on_holo_light.png deleted file mode 100644 index f3257c8f..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/btn_check_on_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/btn_down.9.png b/TMessagesProj/src/main/res/drawable-mdpi/btn_down.9.png deleted file mode 100644 index 96c7adcd..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/btn_down.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/btn_up.9.png b/TMessagesProj/src/main/res/drawable-mdpi/btn_up.9.png deleted file mode 100644 index 2fb6b667..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/btn_up.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_ab_share.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_ab_share.png deleted file mode 100644 index 8b198726..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_ab_share.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_auth_next.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_auth_next.png deleted file mode 100644 index 33c7f7da..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_auth_next.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_done.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_done.png old mode 100644 new mode 100755 index 42653437..e91f9048 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_done.png and b/TMessagesProj/src/main/res/drawable-mdpi/ic_done.png differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_edit.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_edit.png deleted file mode 100644 index 652c748c..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_edit.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_lock_blue.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_lock_blue.png deleted file mode 100644 index 6b9bfdec..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_lock_blue.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_msg_in_cross.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_msg_in_cross.png deleted file mode 100644 index ad7694f7..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_msg_in_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_profile_cross.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_profile_cross.png deleted file mode 100644 index 9f1346e1..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/ic_profile_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photo_edit_spinner.png b/TMessagesProj/src/main/res/drawable-mdpi/photo_edit_spinner.png deleted file mode 100644 index d85d84cd..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/photo_edit_spinner.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_normal.9.png b/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_normal.9.png deleted file mode 100644 index 9d75da73..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_normal.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_pressed.9.png b/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_pressed.9.png deleted file mode 100644 index c50e26cc..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/photo_spinner_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/search_light.9.png b/TMessagesProj/src/main/res/drawable-mdpi/search_light.9.png deleted file mode 100755 index 3f312b46..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/search_light.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/search_light_activated.9.png b/TMessagesProj/src/main/res/drawable-mdpi/search_light_activated.9.png new file mode 100644 index 00000000..8d7b83f7 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-mdpi/search_light_activated.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/search_light_selected.9.png b/TMessagesProj/src/main/res/drawable-mdpi/search_light_selected.9.png deleted file mode 100755 index 27a38472..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/search_light_selected.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/switch_off1.png b/TMessagesProj/src/main/res/drawable-mdpi/switch_off1.png deleted file mode 100755 index b160afb0..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/switch_off1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/switch_off1_pressed.png b/TMessagesProj/src/main/res/drawable-mdpi/switch_off1_pressed.png deleted file mode 100755 index 59f8c82d..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/switch_off1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/switch_on1.png b/TMessagesProj/src/main/res/drawable-mdpi/switch_on1.png deleted file mode 100755 index 27c093e8..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/switch_on1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/switch_on1_pressed.png b/TMessagesProj/src/main/res/drawable-mdpi/switch_on1_pressed.png deleted file mode 100755 index db0e3471..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/switch_on1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/textfield_activated.9.png b/TMessagesProj/src/main/res/drawable-mdpi/textfield_activated.9.png deleted file mode 100644 index 633bcbdd..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/textfield_activated.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/textfield_default.9.png b/TMessagesProj/src/main/res/drawable-mdpi/textfield_default.9.png deleted file mode 100644 index 0f1ba7d5..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/textfield_default.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled.9.png b/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled.9.png deleted file mode 100644 index 3b928944..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled2.9.png b/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled2.9.png deleted file mode 100644 index 09b56164..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/textfield_disabled2.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/textfield_focused.9.png b/TMessagesProj/src/main/res/drawable-mdpi/textfield_focused.9.png deleted file mode 100644 index 45cd1046..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/textfield_focused.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/user_placeholder.png b/TMessagesProj/src/main/res/drawable-mdpi/user_placeholder.png deleted file mode 100644 index 57af7911..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/user_placeholder.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/viewbtn.9.png b/TMessagesProj/src/main/res/drawable-mdpi/viewbtn.9.png deleted file mode 100644 index 61f930ab..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/viewbtn.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/viewbtn_pressed.9.png b/TMessagesProj/src/main/res/drawable-mdpi/viewbtn_pressed.9.png deleted file mode 100644 index d603c67b..00000000 Binary files a/TMessagesProj/src/main/res/drawable-mdpi/viewbtn_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/addmember.png b/TMessagesProj/src/main/res/drawable-xhdpi/addmember.png deleted file mode 100755 index 16d2277a..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/addmember.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_off_holo_light.png b/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_off_holo_light.png deleted file mode 100644 index b843c827..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_off_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_on_holo_light.png b/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_on_holo_light.png deleted file mode 100644 index 3534493c..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/btn_check_on_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/btn_down.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/btn_down.9.png deleted file mode 100644 index b8a0db1c..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/btn_down.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/btn_up.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/btn_up.9.png deleted file mode 100644 index 6f17635d..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/btn_up.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_share.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_share.png deleted file mode 100644 index 16f8b1e9..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_share.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_auth_next.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_auth_next.png deleted file mode 100644 index b53e3133..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_auth_next.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_done.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_done.png old mode 100644 new mode 100755 index 3920f31a..e5024472 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_done.png and b/TMessagesProj/src/main/res/drawable-xhdpi/ic_done.png differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_edit.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_edit.png deleted file mode 100644 index f9fb11b7..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_edit.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_blue.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_blue.png deleted file mode 100644 index 5f7d5aec..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_blue.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_msg_in_cross.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_msg_in_cross.png deleted file mode 100644 index c008a308..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_msg_in_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_profile_cross.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_profile_cross.png deleted file mode 100644 index bd3de23b..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/ic_profile_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/photo_edit_spinner.png b/TMessagesProj/src/main/res/drawable-xhdpi/photo_edit_spinner.png deleted file mode 100644 index d72b80f0..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/photo_edit_spinner.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_normal.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_normal.9.png deleted file mode 100644 index a24c47c5..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_normal.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_pressed.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_pressed.9.png deleted file mode 100644 index 9a8b1254..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/photo_spinner_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/search_light.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/search_light.9.png old mode 100755 new mode 100644 index 4e9ae43c..2514e223 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/search_light.9.png and b/TMessagesProj/src/main/res/drawable-xhdpi/search_light.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/search_light_activated.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/search_light_activated.9.png new file mode 100644 index 00000000..8413643c Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xhdpi/search_light_activated.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/search_light_selected.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/search_light_selected.9.png deleted file mode 100755 index c3268408..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/search_light_selected.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/spenner_pressed.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/spenner_pressed.9.png deleted file mode 100755 index 76e61a30..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/spenner_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1.png b/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1.png deleted file mode 100755 index 20fd7851..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1_pressed.png b/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1_pressed.png deleted file mode 100755 index 55184f89..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/switch_off1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1.png b/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1.png deleted file mode 100755 index 80a262bc..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1_pressed.png b/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1_pressed.png deleted file mode 100755 index 434376d7..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/switch_on1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_activated.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/textfield_activated.9.png deleted file mode 100644 index 2806417d..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_activated.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_default.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/textfield_default.9.png deleted file mode 100644 index 64255467..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_default.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled.9.png deleted file mode 100644 index ddd05596..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled2.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled2.9.png deleted file mode 100644 index dfb21856..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_disabled2.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_focused.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/textfield_focused.9.png deleted file mode 100644 index dda8d829..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/textfield_focused.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/user_placeholder.png b/TMessagesProj/src/main/res/drawable-xhdpi/user_placeholder.png deleted file mode 100644 index b6b7e7b8..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/user_placeholder.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn.9.png deleted file mode 100644 index 97d12567..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn_pressed.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn_pressed.9.png deleted file mode 100644 index d3a8cff9..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xhdpi/viewbtn_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/addmember.png b/TMessagesProj/src/main/res/drawable-xxhdpi/addmember.png deleted file mode 100755 index 80dc6e1c..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/addmember.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_off_holo_light.png b/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_off_holo_light.png deleted file mode 100644 index 8bf25ec8..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_off_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_on_holo_light.png b/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_on_holo_light.png deleted file mode 100644 index 50593ac4..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_check_on_holo_light.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_down.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/btn_down.9.png deleted file mode 100644 index 07482b4e..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_down.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_up.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/btn_up.9.png deleted file mode 100644 index 2469b213..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/btn_up.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_share.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_share.png deleted file mode 100644 index 231da7f0..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_share.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_auth_next.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_auth_next.png deleted file mode 100644 index ea19fa60..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_auth_next.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_done.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_done.png old mode 100644 new mode 100755 index 9cbb9ad3..f801e7ab Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_done.png and b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_done.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_edit.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_edit.png deleted file mode 100644 index cd4bc7bc..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_edit.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_blue.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_blue.png deleted file mode 100644 index d4b04dbf..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_blue.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_msg_in_cross.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_msg_in_cross.png deleted file mode 100644 index 303ea0f3..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_msg_in_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_profile_cross.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_profile_cross.png deleted file mode 100644 index be492a73..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_profile_cross.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_edit_spinner.png b/TMessagesProj/src/main/res/drawable-xxhdpi/photo_edit_spinner.png deleted file mode 100644 index 6e913581..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_edit_spinner.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_normal.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_normal.9.png deleted file mode 100644 index 036e238d..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_normal.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_pressed.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_pressed.9.png deleted file mode 100644 index 73bea535..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/photo_spinner_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark.9.png new file mode 100644 index 00000000..6df53875 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark_activated.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark_activated.9.png new file mode 100644 index 00000000..3a49d9ba Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xxhdpi/search_dark_activated.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/search_light.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/search_light.9.png new file mode 100644 index 00000000..f2f7727f Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xxhdpi/search_light.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/search_light_activated.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/search_light_activated.9.png new file mode 100644 index 00000000..d7852f27 Binary files /dev/null and b/TMessagesProj/src/main/res/drawable-xxhdpi/search_light_activated.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/spinner.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/spinner.9.png index c0930b4b..a0a5116d 100755 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/spinner.9.png and b/TMessagesProj/src/main/res/drawable-xxhdpi/spinner.9.png differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1.png b/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1.png deleted file mode 100755 index 4af7844c..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1_pressed.png b/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1_pressed.png deleted file mode 100755 index e015ee73..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_off1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1.png b/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1.png deleted file mode 100755 index 5c3d2497..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1_pressed.png b/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1_pressed.png deleted file mode 100755 index 1b9ecf28..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/switch_on1_pressed.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/user_placeholder.png b/TMessagesProj/src/main/res/drawable-xxhdpi/user_placeholder.png deleted file mode 100644 index bf04c8e2..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/user_placeholder.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn.9.png deleted file mode 100644 index 819b7d81..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn_pressed.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn_pressed.9.png deleted file mode 100644 index e04af7c9..00000000 Binary files a/TMessagesProj/src/main/res/drawable-xxhdpi/viewbtn_pressed.9.png and /dev/null differ diff --git a/TMessagesProj/src/main/res/drawable/btn_check_off.xml b/TMessagesProj/src/main/res/drawable/btn_check_off.xml deleted file mode 100644 index 5e1ee0ac..00000000 --- a/TMessagesProj/src/main/res/drawable/btn_check_off.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/btn_check_on.xml b/TMessagesProj/src/main/res/drawable/btn_check_on.xml deleted file mode 100644 index beba706c..00000000 --- a/TMessagesProj/src/main/res/drawable/btn_check_on.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/chat_incoming_media_states.xml b/TMessagesProj/src/main/res/drawable/chat_incoming_media_states.xml deleted file mode 100644 index 671c4fcb..00000000 --- a/TMessagesProj/src/main/res/drawable/chat_incoming_media_states.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/edit_text.xml b/TMessagesProj/src/main/res/drawable/edit_text.xml index 492bc906..287901e7 100644 --- a/TMessagesProj/src/main/res/drawable/edit_text.xml +++ b/TMessagesProj/src/main/res/drawable/edit_text.xml @@ -1,11 +1,8 @@ - - - - - - - + + + + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/list_selector.xml b/TMessagesProj/src/main/res/drawable/list_selector.xml index fff3038c..f311824b 100644 --- a/TMessagesProj/src/main/res/drawable/list_selector.xml +++ b/TMessagesProj/src/main/res/drawable/list_selector.xml @@ -1,6 +1,5 @@ - + diff --git a/TMessagesProj/src/main/res/drawable/logout_button_states.xml b/TMessagesProj/src/main/res/drawable/logout_button_states.xml deleted file mode 100644 index 56694e45..00000000 --- a/TMessagesProj/src/main/res/drawable/logout_button_states.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/photo_spinner.xml b/TMessagesProj/src/main/res/drawable/photo_spinner.xml deleted file mode 100644 index d09b405a..00000000 --- a/TMessagesProj/src/main/res/drawable/photo_spinner.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/drawable/search_dark_states.xml b/TMessagesProj/src/main/res/drawable/search_dark_states.xml new file mode 100644 index 00000000..d1d4b459 --- /dev/null +++ b/TMessagesProj/src/main/res/drawable/search_dark_states.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/TMessagesProj/src/main/res/drawable/search_light_states.xml b/TMessagesProj/src/main/res/drawable/search_light_states.xml old mode 100755 new mode 100644 index 11282d4c..d1d4b459 --- a/TMessagesProj/src/main/res/drawable/search_light_states.xml +++ b/TMessagesProj/src/main/res/drawable/search_light_states.xml @@ -1,8 +1,7 @@ - - - + + + + - diff --git a/TMessagesProj/src/main/res/drawable/spinner_states.xml b/TMessagesProj/src/main/res/drawable/spinner_states.xml index 649376f3..92fb773c 100644 --- a/TMessagesProj/src/main/res/drawable/spinner_states.xml +++ b/TMessagesProj/src/main/res/drawable/spinner_states.xml @@ -1,7 +1,7 @@ - - - + + + \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout-ar/country_select_layout.xml b/TMessagesProj/src/main/res/layout-ar/country_select_layout.xml deleted file mode 100644 index 45a52826..00000000 --- a/TMessagesProj/src/main/res/layout-ar/country_select_layout.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - diff --git a/TMessagesProj/src/main/res/layout-ar/group_create_final_layout.xml b/TMessagesProj/src/main/res/layout-ar/group_create_final_layout.xml index f821e53e..c4e674df 100644 --- a/TMessagesProj/src/main/res/layout-ar/group_create_final_layout.xml +++ b/TMessagesProj/src/main/res/layout-ar/group_create_final_layout.xml @@ -23,12 +23,6 @@ android:layout_width="fill_parent" android:layout_height="fill_parent"/> - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout-ar/settings_row_button_layout.xml b/TMessagesProj/src/main/res/layout-ar/settings_row_button_layout.xml deleted file mode 100644 index 587eb212..00000000 --- a/TMessagesProj/src/main/res/layout-ar/settings_row_button_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/chat_profile_layout.xml b/TMessagesProj/src/main/res/layout/chat_profile_layout.xml deleted file mode 100644 index 57fd376d..00000000 --- a/TMessagesProj/src/main/res/layout/chat_profile_layout.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/TMessagesProj/src/main/res/layout/country_select_layout.xml b/TMessagesProj/src/main/res/layout/country_select_layout.xml deleted file mode 100644 index 2ce0b92b..00000000 --- a/TMessagesProj/src/main/res/layout/country_select_layout.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - diff --git a/TMessagesProj/src/main/res/layout/group_create_final_layout.xml b/TMessagesProj/src/main/res/layout/group_create_final_layout.xml index ba3f3ce3..8f2b4089 100644 --- a/TMessagesProj/src/main/res/layout/group_create_final_layout.xml +++ b/TMessagesProj/src/main/res/layout/group_create_final_layout.xml @@ -23,12 +23,6 @@ android:layout_width="fill_parent" android:layout_height="fill_parent"/> - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/group_profile_add_member_layout.xml b/TMessagesProj/src/main/res/layout/group_profile_add_member_layout.xml deleted file mode 100644 index 60c5e3e7..00000000 --- a/TMessagesProj/src/main/res/layout/group_profile_add_member_layout.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/login_layout.xml b/TMessagesProj/src/main/res/layout/login_layout.xml index 70818ccc..5404684d 100644 --- a/TMessagesProj/src/main/res/layout/login_layout.xml +++ b/TMessagesProj/src/main/res/layout/login_layout.xml @@ -248,26 +248,6 @@ android:textColorHint="#979797" android:layout_marginTop="10dp"/> - - - - - - - - - - - - - - - - - - - - - - -