Rename ApplicationActivity -> LaunchActivity

Don’t want to lose app shortcut (who knew about it)
This commit is contained in:
DrKLO 2014-03-05 00:04:57 +04:00
parent ba726700a1
commit 2518d0e91f
24 changed files with 119 additions and 119 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.telegram.messenger"
android:versionCode="181"
android:versionCode="182"
android:versionName="1.3.26">
<supports-screens android:anyDensity="true"
@ -71,25 +71,7 @@
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity
android:name="org.telegram.ui.LoginActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.CountrySelectActivity"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.TMessages"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.IntroActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.ApplicationActivity"
android:name="org.telegram.ui.LaunchActivity"
android:windowSoftInputMode="adjustResize"
android:hardwareAccelerated="true"
android:launchMode="singleTask"
@ -134,6 +116,24 @@
<data android:mimeType="vnd.android.cursor.item/vnd.org.telegram.messenger.android.profile"/>
</intent-filter>
</activity>
<activity
android:name="org.telegram.ui.LoginActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.CountrySelectActivity"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.TMessages"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.IntroActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait">
</activity>
<activity
android:name="org.telegram.ui.GalleryImageViewer"
android:theme="@style/Theme.TMessages.Gallery"

View file

@ -34,7 +34,7 @@ import android.util.SparseArray;
import org.telegram.objects.MessageObject;
import org.telegram.objects.PhotoObject;
import org.telegram.ui.ApplicationActivity;
import org.telegram.ui.LaunchActivity;
import org.telegram.ui.ApplicationLoader;
import java.io.File;
@ -4188,7 +4188,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
String chatSoundPath = null;
NotificationManager mNotificationManager = (NotificationManager)ApplicationLoader.applicationContext.getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(ApplicationLoader.applicationContext, ApplicationActivity.class);
Intent intent = new Intent(ApplicationLoader.applicationContext, LaunchActivity.class);
String msg = null;
if ((int)dialog_id != 0) {

View file

@ -242,7 +242,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
args.putBoolean("serverOnly", true);
fragment.setArguments(args);
fragment.delegate = ChatActivity.this;
((ApplicationActivity)parentActivity).presentFragment(fragment, "select_chat", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "select_chat", false);
break;
}
}
@ -2056,7 +2056,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("user_id", currentUser.id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "add_contact_" + currentUser.id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + currentUser.id, false);
}
});
}
@ -2175,7 +2175,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
actionBar.setDisplayShowCustomEnabled(false);
actionBar.setCustomView(null);
updateSubtitle();
((ApplicationActivity)parentActivity).fixBackButton();
((LaunchActivity)parentActivity).fixBackButton();
}
@Override
@ -2214,8 +2214,8 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
fixLayout();
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
String lastMessageText = preferences.getString("dialog_" + dialog_id, null);
@ -2380,7 +2380,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
args.putLong("dialog_id", dialog_id);
}
fragment.setArguments(args);
((ApplicationActivity) parentActivity).presentFragment(fragment, "user_" + currentUser.id, swipeOpening);
((LaunchActivity) parentActivity).presentFragment(fragment, "user_" + currentUser.id, swipeOpening);
} else if (currentChat != null) {
if (info != null) {
if (info instanceof TLRPC.TL_chatParticipantsForbidden) {
@ -2395,7 +2395,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("chat_id", currentChat.id);
fragment.setArguments(args);
((ApplicationActivity) parentActivity).presentFragment(fragment, "chat_" + currentChat.id, swipeOpening);
((LaunchActivity) parentActivity).presentFragment(fragment, "chat_" + currentChat.id, swipeOpening);
}
}
});
@ -2614,7 +2614,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
args.putBoolean("serverOnly", true);
fragment.setArguments(args);
fragment.delegate = this;
((ApplicationActivity)parentActivity).presentFragment(fragment, "select_chat", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "select_chat", false);
}
} else if (option == 3) {
if (selectedObject != null) {
@ -2677,14 +2677,14 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
fragment.scrollToTopOnResume = true;
ActionBarActivity act = (ActionBarActivity)getActivity();
if (inflaterActivity != null) {
((ApplicationActivity)inflaterActivity).presentFragment(fragment, "chat" + Math.random(), false);
((LaunchActivity)inflaterActivity).presentFragment(fragment, "chat" + Math.random(), false);
}
} else if (lower_part < 0) {
bundle.putInt("chat_id", -lower_part);
fragment.setArguments(bundle);
fragment.scrollToTopOnResume = true;
if (inflaterActivity != null) {
((ApplicationActivity)inflaterActivity).presentFragment(fragment, "chat" + Math.random(), false);
((LaunchActivity)inflaterActivity).presentFragment(fragment, "chat" + Math.random(), false);
}
}
removeSelfFromStack();
@ -2800,13 +2800,13 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
return true;
}
LocationActivity fragment = new LocationActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "location", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "location", false);
break;
}
case R.id.attach_document: {
DocumentSelectActivity fragment = new DocumentSelectActivity();
fragment.delegate = this;
((ApplicationActivity)parentActivity).presentFragment(fragment, "document", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "document", false);
break;
}
}
@ -3097,7 +3097,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("user_id", user.id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + user.id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + user.id, false);
}
}
};
@ -3699,7 +3699,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
args.putInt("user_id", message.messageOwner.media.user_id);
args.putString("phone", message.messageOwner.media.phone_number);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "add_contact_" + message.messageOwner.media.user_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + message.messageOwner.media.user_id, false);
}
});
@ -3728,7 +3728,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("user_id", message.messageOwner.media.user_id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.user_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.user_id, false);
}
}
}
@ -3753,7 +3753,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("user_id", message.messageOwner.media.audio.user_id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.audio.user_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.audio.user_id, false);
}
}
}
@ -3782,7 +3782,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
Bundle args = new Bundle();
args.putInt("user_id", message.messageOwner.from_id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.from_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.from_id, false);
}
}
});
@ -3883,7 +3883,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
}
NotificationCenter.Instance.addToMemCache(0, message);
LocationActivity fragment = new LocationActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "location_view", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "location_view", false);
} else if (message.type == 2 || message.type == 3) {
if (photoFile == null || photoObjectToSet == null || photoFile != null && photoFile.exists()) {
NotificationCenter.Instance.addToMemCache(51, message);

View file

@ -194,7 +194,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
Bundle bundle = new Bundle();
bundle.putLong("dialog_id", -chat_id);
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "media_chat_" + chat_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "media_chat_" + chat_id, false);
} else {
int size = 0;
if (info != null) {
@ -209,7 +209,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
Bundle args = new Bundle();
args.putInt("user_id", user_id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + user_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "user_" + user_id, false);
} else {
if (size + 7 == i) {
if (info.participants.size() < 200) {
@ -332,7 +332,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
title.setCompoundDrawablePadding(0);
}
((ApplicationActivity)parentActivity).fixBackButton();
((LaunchActivity)parentActivity).fixBackButton();
}
@Override
@ -344,8 +344,8 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
if (listViewAdapter != null) {
listViewAdapter.notifyDataSetChanged();
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
@Override
@ -457,7 +457,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
NotificationCenter.Instance.addToMemCache(7, users);
}
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "contacts_block", false);
((LaunchActivity)parentActivity).presentFragment(fragment, "contacts_block", false);
}
private void kickUser(TLRPC.TL_chatParticipant user) {
@ -549,7 +549,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
Bundle bundle = new Bundle();
bundle.putInt("chat_id", chat_id);
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "chat_name_" + chat_id, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "chat_name_" + chat_id, false);
}
});

View file

@ -129,7 +129,7 @@ public class ChatProfileChangeNameActivity extends BaseFragment {
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).updateActionBar();
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
boolean animations = preferences.getBoolean("view_animations", true);

View file

@ -214,7 +214,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).updateActionBar();
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
boolean animations = preferences.getBoolean("view_animations", true);

View file

@ -174,7 +174,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
Bundle bundle = new Bundle();
bundle.putInt("user_id", user.id);
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), destroyAfterSelect, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), destroyAfterSelect, false);
}
}
} else {
@ -235,7 +235,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
Bundle bundle = new Bundle();
bundle.putInt("user_id", user.id);
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), destroyAfterSelect, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), destroyAfterSelect, false);
}
}
} else {
@ -357,7 +357,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
actionBar.setTitle(getStringEntry(R.string.Contacts));
}
((ApplicationActivity)parentActivity).fixBackButton();
((LaunchActivity)parentActivity).fixBackButton();
}
@Override
@ -373,8 +373,8 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
listViewAdapter.notifyDataSetChanged();
}
firstStart = false;
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
@Override
@ -478,7 +478,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
}
listView.setFastScrollEnabled(true);
listView.setVerticalScrollBarEnabled(false);
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).updateActionBar();
epmtyTextView.setText(getStringEntry(R.string.NoContacts));
return true;
@ -504,7 +504,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
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);
}
}
}

View file

@ -240,8 +240,8 @@ public class DocumentSelectActivity extends BaseFragment {
listAdapter.notifyDataSetChanged();
}
firstStart = false;
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
@Override

View file

@ -294,8 +294,8 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
public Emoji.XImageSpan createAndPutChipForUser(TLRPC.User user) {
@ -426,7 +426,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
} else {
return;
}
((ApplicationActivity)parentActivity).presentFragment(new GroupCreateFinalActivity(), "group_craate_final", false);
((LaunchActivity)parentActivity).presentFragment(new GroupCreateFinalActivity(), "group_craate_final", false);
}
});
}

View file

@ -162,8 +162,8 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
@Override
@ -244,7 +244,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati
Bundle bundle = new Bundle();
bundle.putInt("chat_id", (Integer)args[0]);
fragment.setArguments(bundle);
((ApplicationActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false);
((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), true, false);
}
});
}

View file

@ -111,8 +111,8 @@ public class IdenticonActivity extends BaseFragment {
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
fixLayout();
}

View file

@ -51,7 +51,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
public class ApplicationActivity extends ActionBarActivity implements NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate {
public class LaunchActivity extends ActionBarActivity implements NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate {
private boolean finished = false;
private NotificationView notificationView;
private Uri photoPath = null;

View file

@ -207,8 +207,8 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
@Override

View file

@ -239,7 +239,7 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV
@Override
public void needFinishActivity() {
Intent intent2 = new Intent(this, ApplicationActivity.class);
Intent intent2 = new Intent(this, LaunchActivity.class);
startActivity(intent2);
finish();
}

View file

@ -271,8 +271,8 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
listAdapter.notifyDataSetChanged();
}
firstStart = false;
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).showActionBar();
((LaunchActivity)parentActivity).updateActionBar();
fixLayout();
}

View file

@ -193,17 +193,17 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
if (lower_part > 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:

View file

@ -380,6 +380,6 @@ public class PhotoCropActivity extends BaseFragment {
if (getActivity() == null) {
return;
}
((ApplicationActivity)parentActivity).updateActionBar();
((LaunchActivity)parentActivity).updateActionBar();
}
}

View file

@ -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);
}
});

View file

@ -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;

View file

@ -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

View file

@ -424,7 +424,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
listAdapter.notifyDataSetChanged();
}
((ApplicationActivity) parentActivity).hideActionBar();
((LaunchActivity) parentActivity).hideActionBar();
processSelectedBackground();

View file

@ -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);

View file

@ -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;

View file

@ -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();