From 2518d0e91f65e8e442575787c1cc6ad54288f290 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Wed, 5 Mar 2014 00:04:57 +0400 Subject: [PATCH] Rename ApplicationActivity -> LaunchActivity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t want to lose app shortcut (who knew about it) --- TMessagesProj/src/main/AndroidManifest.xml | 40 +++++++++---------- .../messenger/MessagesController.java | 4 +- .../java/org/telegram/ui/ChatActivity.java | 36 ++++++++--------- .../org/telegram/ui/ChatProfileActivity.java | 14 +++---- .../ui/ChatProfileChangeNameActivity.java | 2 +- .../org/telegram/ui/ContactAddActivity.java | 2 +- .../org/telegram/ui/ContactsActivity.java | 14 +++---- .../telegram/ui/DocumentSelectActivity.java | 4 +- .../org/telegram/ui/GroupCreateActivity.java | 6 +-- .../telegram/ui/GroupCreateFinalActivity.java | 6 +-- .../org/telegram/ui/IdenticonActivity.java | 4 +- ...ationActivity.java => LaunchActivity.java} | 2 +- .../org/telegram/ui/LocationActivity.java | 4 +- .../java/org/telegram/ui/LoginActivity.java | 2 +- .../java/org/telegram/ui/MediaActivity.java | 4 +- .../org/telegram/ui/MessagesActivity.java | 24 +++++------ .../org/telegram/ui/PhotoCropActivity.java | 2 +- .../org/telegram/ui/SettingsActivity.java | 16 ++++---- .../org/telegram/ui/SettingsBlockedUsers.java | 10 ++--- .../ui/SettingsNotificationsActivity.java | 4 +- .../ui/SettingsWallpapersActivity.java | 2 +- .../org/telegram/ui/UserProfileActivity.java | 24 +++++------ .../org/telegram/ui/Views/AvatarUpdater.java | 6 +-- .../org/telegram/ui/Views/BaseFragment.java | 6 +-- 24 files changed, 119 insertions(+), 119 deletions(-) rename TMessagesProj/src/main/java/org/telegram/ui/{ApplicationActivity.java => LaunchActivity.java} (99%) diff --git a/TMessagesProj/src/main/AndroidManifest.xml b/TMessagesProj/src/main/AndroidManifest.xml index b8cee55f3..3f7fa05c0 100644 --- a/TMessagesProj/src/main/AndroidManifest.xml +++ b/TMessagesProj/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ - - - - - - + + + + + + 0) { bundle.putInt("user_id", lower_part); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); } else if (lower_part < 0) { bundle.putInt("chat_id", -lower_part); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); } } else { int id = (int)(dialog_id >> 32); bundle.putInt("enc_id", id); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); } } } @@ -306,7 +306,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter actionBar.setSubtitle(null); actionBar.setCustomView(null); actionBar.setTitle(getStringEntry(R.string.SelectChat)); - ((ApplicationActivity)parentActivity).fixBackButton(); + ((LaunchActivity)parentActivity).fixBackButton(); } else { ImageView view = (ImageView)parentActivity.findViewById(16908332); if (view == null) { @@ -349,8 +349,8 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter if (messagesListViewAdapter != null) { messagesListViewAdapter.notifyDataSetChanged(); } - ((ApplicationActivity)parentActivity).showActionBar(); - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).showActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); } @Override @@ -607,7 +607,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter messagesListViewAdapter.notifyDataSetChanged(); } if (onlySelect) { - ((ApplicationActivity)parentActivity).fixBackButton(); + ((LaunchActivity)parentActivity).fixBackButton(); } return true; } @@ -629,11 +629,11 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter switch (itemId) { case R.id.messages_list_menu_settings: { - ((ApplicationActivity)inflaterActivity).presentFragment(new SettingsActivity(), "settings", false); + ((LaunchActivity)inflaterActivity).presentFragment(new SettingsActivity(), "settings", false); break; } case R.id.messages_list_menu_contacts: { - ((ApplicationActivity)inflaterActivity).presentFragment(new ContactsActivity(), "contacts", false); + ((LaunchActivity)inflaterActivity).presentFragment(new ContactsActivity(), "contacts", false); break; } case R.id.messages_list_menu_new_messages: { @@ -644,7 +644,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter bundle.putBoolean("usersAsSections", true); fragment.animationType = 1; fragment.setArguments(bundle); - ((ApplicationActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); + ((LaunchActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); break; } case R.id.messages_list_menu_new_secret_chat: { @@ -656,11 +656,11 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter bundle.putBoolean("createSecretChat", true); fragment.animationType = 1; fragment.setArguments(bundle); - ((ApplicationActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); + ((LaunchActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); break; } case R.id.messages_list_menu_new_chat: { - ((ApplicationActivity)inflaterActivity).presentFragment(new GroupCreateActivity(), "group_create", false); + ((LaunchActivity)inflaterActivity).presentFragment(new GroupCreateActivity(), "group_create", false); break; } case android.R.id.home: diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java index 4cea26ebb..f013d9681 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoCropActivity.java @@ -380,6 +380,6 @@ public class PhotoCropActivity extends BaseFragment { if (getActivity() == null) { return; } - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index 0d15da117..5152cf12b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -223,11 +223,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter listView.invalidateViews(); } } else if (i == notificationRow) { - ((ApplicationActivity)parentActivity).presentFragment(new SettingsNotificationsActivity(), "settings_notifications", false); + ((LaunchActivity)parentActivity).presentFragment(new SettingsNotificationsActivity(), "settings_notifications", false); } else if (i == blockedRow) { - ((ApplicationActivity)parentActivity).presentFragment(new SettingsBlockedUsers(), "settings_blocked", false); + ((LaunchActivity)parentActivity).presentFragment(new SettingsBlockedUsers(), "settings_blocked", false); } else if (i == backgroundRow) { - ((ApplicationActivity)parentActivity).presentFragment(new SettingsWallpapersActivity(), "settings_wallpapers", false); + ((LaunchActivity)parentActivity).presentFragment(new SettingsWallpapersActivity(), "settings_wallpapers", false); } else if (i == askQuestionRow) { final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); int uid = preferences.getInt("support_id", 0); @@ -286,7 +286,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter Bundle bundle = new Bundle(); bundle.putInt("user_id", res.user.id); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); } }); } else { @@ -309,7 +309,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter Bundle bundle = new Bundle(); bundle.putInt("user_id", supportUser.id); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); } } else if (i == sendLogsRow) { sendLogs(); @@ -478,8 +478,8 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter listAdapter.notifyDataSetChanged(); } firstStart = false; - ((ApplicationActivity)parentActivity).showActionBar(); - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).showActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); } @Override @@ -544,7 +544,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - ((ApplicationActivity)parentActivity).presentFragment(new SettingsChangeNameActivity(), "change_name", false); + ((LaunchActivity)parentActivity).presentFragment(new SettingsChangeNameActivity(), "change_name", false); } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java index 9fb79034e..ecf55be26 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java @@ -95,7 +95,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe Bundle args = new Bundle(); args.putInt("user_id", blockedContacts.get(i).user_id); fragment.setArguments(args); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + blockedContacts.get(i).user_id, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + blockedContacts.get(i).user_id, false); } } }); @@ -269,7 +269,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); title.setCompoundDrawablePadding(0); } - ((ApplicationActivity)parentActivity).fixBackButton(); + ((LaunchActivity)parentActivity).fixBackButton(); } @Override @@ -285,8 +285,8 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe listViewAdapter.notifyDataSetChanged(); } firstStart = false; - ((ApplicationActivity)parentActivity).showActionBar(); - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).showActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); } public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { @@ -310,7 +310,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe bundle.putBoolean("returnAsResult", true); fragment.delegate = this; fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "contacts_block", false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "contacts_block", false); break; } return true; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java index f4de45f30..42a1e5cf3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java @@ -292,8 +292,8 @@ public class SettingsNotificationsActivity extends BaseFragment { if (getActivity() == null) { return; } - ((ApplicationActivity)parentActivity).showActionBar(); - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).showActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java index 4b4948bfd..5bcb4cef6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java @@ -424,7 +424,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica listAdapter.notifyDataSetChanged(); } - ((ApplicationActivity) parentActivity).hideActionBar(); + ((LaunchActivity) parentActivity).hideActionBar(); processSelectedBackground(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java index faf8e424d..14b9535fd 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java @@ -178,13 +178,13 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen bundle.putLong("dialog_id", user_id); } fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "media_user_" + user_id, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "media_user_" + user_id, false); } else if (i == 5 && dialog_id != 0 && currentEncryptedChat instanceof TLRPC.TL_encryptedChat) { IdenticonActivity fragment = new IdenticonActivity(); Bundle bundle = new Bundle(); bundle.putInt("chat_id", (int)(dialog_id >> 32)); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "key_" + dialog_id, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "key_" + dialog_id, false); } else if (i == 4 && dialog_id != 0 && currentEncryptedChat instanceof TLRPC.TL_encryptedChat) { AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); builder.setTitle(getStringEntry(R.string.MessageLifetime)); @@ -312,7 +312,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen Bundle bundle = new Bundle(); bundle.putInt("enc_id", encryptedChat.id); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); } } else if (id == MessagesController.encryptedChatUpdated) { TLRPC.EncryptedChat chat = (TLRPC.EncryptedChat)args[0]; @@ -373,8 +373,8 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen listAdapter.notifyDataSetChanged(); } firstStart = false; - ((ApplicationActivity)parentActivity).showActionBar(); - ((ApplicationActivity)parentActivity).updateActionBar(); + ((LaunchActivity)parentActivity).showActionBar(); + ((LaunchActivity)parentActivity).updateActionBar(); fixLayout(); } @@ -439,7 +439,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen Bundle args = new Bundle(); args.putInt("user_id", user.id); fragment.setArguments(args); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "add_contact_" + user.id, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + user.id, false); break; } case R.id.share_contact: { @@ -449,7 +449,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen args.putBoolean("serverOnly", true); fragment.setArguments(args); fragment.delegate = this; - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat_select", false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat_select", false); break; } case R.id.edit_contact: { @@ -457,7 +457,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen Bundle args = new Bundle(); args.putInt("user_id", user_id); fragment.setArguments(args); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "add_contact_" + user_id, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + user_id, false); break; } case R.id.delete_contact: { @@ -513,7 +513,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen bundle.putInt("user_id", lower_part); fragment.setArguments(bundle); fragment.scrollToTopOnResume = true; - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); removeSelfFromStack(); messageFragment.removeSelfFromStack(); } else if (lower_part < 0) { @@ -521,7 +521,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen bundle.putInt("chat_id", -lower_part); fragment.setArguments(bundle); fragment.scrollToTopOnResume = true; - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); messageFragment.removeSelfFromStack(); removeSelfFromStack(); } @@ -531,7 +531,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen bundle.putInt("enc_id", id); fragment.setArguments(bundle); fragment.scrollToTopOnResume = true; - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); messageFragment.removeSelfFromStack(); removeSelfFromStack(); } @@ -730,7 +730,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen Bundle bundle = new Bundle(); bundle.putInt("user_id", user_id); fragment.setArguments(bundle); - ((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false); } }); TextView textView = (TextView)view.findViewById(R.id.settings_row_text); 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 51b01bf05..320a36569 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java @@ -21,7 +21,7 @@ import org.telegram.messenger.FileLog; import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; -import org.telegram.ui.ApplicationActivity; +import org.telegram.ui.LaunchActivity; import org.telegram.ui.PhotoCropActivity; import java.io.File; @@ -76,9 +76,9 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg private void startCrop(String path, Uri uri) { try { - ApplicationActivity activity = (ApplicationActivity)parentFragment.parentActivity; + LaunchActivity activity = (LaunchActivity)parentFragment.parentActivity; if (activity == null) { - activity = (ApplicationActivity)parentFragment.getActivity(); + activity = (LaunchActivity)parentFragment.getActivity(); } if (activity == null) { return; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java index 84b642043..d29e0f046 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java @@ -17,7 +17,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import org.telegram.messenger.ConnectionsManager; -import org.telegram.ui.ApplicationActivity; +import org.telegram.ui.LaunchActivity; import org.telegram.ui.ApplicationLoader; public class BaseFragment extends Fragment { @@ -55,7 +55,7 @@ public class BaseFragment extends Fragment { onFragmentDestroy(); return; } - ((ApplicationActivity)parentActivity).finishFragment(bySwipe); + ((LaunchActivity)parentActivity).finishFragment(bySwipe); if (getActivity() == null) { if (fragmentView != null) { ViewGroup parent = (ViewGroup)fragmentView.getParent(); @@ -80,7 +80,7 @@ public class BaseFragment extends Fragment { onFragmentDestroy(); return; } - ((ApplicationActivity)parentActivity).removeFromStack(this); + ((LaunchActivity)parentActivity).removeFromStack(this); if (getActivity() == null) { if (fragmentView != null) { ViewGroup parent = (ViewGroup)fragmentView.getParent();