mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Rename Settings*Activity to what they are, a Settings*Fragment.
This commit is contained in:
@@ -24,9 +24,7 @@
|
||||
package com.b44t.messenger;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -40,11 +38,10 @@ import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Handler;
|
||||
import android.os.PowerManager;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.b44t.ui.Components.ForegroundDetector;
|
||||
import com.b44t.ui.SettingsAdvActivity;
|
||||
import com.b44t.ui.SettingsAdvFragment;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -223,7 +220,7 @@ public class ApplicationLoader extends Application {
|
||||
|
||||
// create other default objects
|
||||
SharedPreferences mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
fontSize = mainPreferences.getInt("msg_font_size", SettingsAdvActivity.defMsgFontSize());
|
||||
fontSize = mainPreferences.getInt("msg_font_size", SettingsAdvFragment.defMsgFontSize());
|
||||
|
||||
ImageLoader.getInstance();
|
||||
MediaController.getInstance();
|
||||
|
||||
@@ -330,7 +330,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
args.putInt("chat_id", MrChat.MR_CHAT_ID_DEADDROP);
|
||||
presentFragment(new ChatActivity(args));
|
||||
} else if (id == ID_SETTINGS) {
|
||||
presentFragment(new SettingsActivity());
|
||||
presentFragment(new SettingsFragment());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
package com.b44t.ui;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ContentResolver;
|
||||
@@ -154,7 +153,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||
if ( MrMailbox.isConfigured()==0 ) {
|
||||
Bundle args = new Bundle();
|
||||
args.putBoolean("fromIntro", true);
|
||||
actionBarLayout.addFragmentToStack(new SettingsAccountActivity(args));
|
||||
actionBarLayout.addFragmentToStack(new SettingsAccountFragment(args));
|
||||
} else {
|
||||
actionBarLayout.addFragmentToStack(new DialogsActivity(null));
|
||||
}
|
||||
@@ -174,7 +173,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||
}
|
||||
break;
|
||||
case "settings": {
|
||||
SettingsActivity settings = new SettingsActivity();
|
||||
SettingsFragment settings = new SettingsFragment();
|
||||
actionBarLayout.addFragmentToStack(settings);
|
||||
settings.restoreSelfArgs(savedInstanceState);
|
||||
break;
|
||||
@@ -955,7 +954,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
|
||||
if (lastFragment instanceof ChatActivity && args != null) {
|
||||
outState.putBundle("args", args);
|
||||
outState.putString("fragment", "chat");
|
||||
} else if (lastFragment instanceof SettingsActivity) {
|
||||
} else if (lastFragment instanceof SettingsFragment) {
|
||||
outState.putString("fragment", "settings");
|
||||
} else if (lastFragment instanceof GroupCreateFinalActivity && args != null) {
|
||||
outState.putBundle("args", args);
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ import com.b44t.ui.Cells.TextSettingsCell;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
|
||||
|
||||
public class SettingsAccountActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
public class SettingsAccountFragment extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
|
||||
// the list
|
||||
private ListView listView;
|
||||
@@ -114,7 +114,7 @@ public class SettingsAccountActivity extends BaseFragment implements Notificatio
|
||||
private boolean fromIntro;
|
||||
private boolean m_expanded = false;
|
||||
|
||||
public SettingsAccountActivity(Bundle args) {
|
||||
public SettingsAccountFragment(Bundle args) {
|
||||
super();
|
||||
if( args!=null ) {
|
||||
fromIntro = args.getBoolean("fromIntro", false);
|
||||
+4
-5
@@ -31,7 +31,6 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.MediaScannerConnection;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
@@ -64,7 +63,7 @@ import com.b44t.ui.Components.NumberPicker;
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public class SettingsAdvActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
public class SettingsAdvFragment extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
|
||||
// the list
|
||||
private int accountSettingsRow;
|
||||
@@ -240,7 +239,7 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
|
||||
}
|
||||
else if(i==accountSettingsRow)
|
||||
{
|
||||
presentFragment(new SettingsAccountActivity(null));
|
||||
presentFragment(new SettingsAccountFragment(null));
|
||||
}
|
||||
else if(i==manageKeysRow )
|
||||
{
|
||||
@@ -263,7 +262,7 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
|
||||
final NumberPicker numberPicker = new NumberPicker(getParentActivity());
|
||||
final int MIN_VAL = 12;
|
||||
final int MAX_VAL = 30;
|
||||
final int DEF_VAL = SettingsAdvActivity.defMsgFontSize();
|
||||
final int DEF_VAL = SettingsAdvFragment.defMsgFontSize();
|
||||
String displayValues[] = new String[MAX_VAL-MIN_VAL+1];
|
||||
for( int v = MIN_VAL; v <= MAX_VAL; v++ ) {
|
||||
String cur = String.format("%d", v);
|
||||
@@ -555,7 +554,7 @@ public class SettingsAdvActivity extends BaseFragment implements NotificationCen
|
||||
}
|
||||
else if (i == textSizeRow) {
|
||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
int size = preferences.getInt("msg_font_size", SettingsAdvActivity.defMsgFontSize());
|
||||
int size = preferences.getInt("msg_font_size", SettingsAdvFragment.defMsgFontSize());
|
||||
textCell.setTextAndValue(mContext.getString(R.string.TextSize), String.format("%d", size), true);
|
||||
}
|
||||
} else if (type == ROWTYPE_CHECK) {
|
||||
+4
-4
@@ -51,7 +51,7 @@ import com.b44t.ui.Cells.TextSettingsCell;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
|
||||
|
||||
public class SettingsActivity extends BaseFragment {
|
||||
public class SettingsFragment extends BaseFragment {
|
||||
|
||||
// the list
|
||||
private int profileRow, nameAndStatusRow;
|
||||
@@ -133,7 +133,7 @@ public class SettingsActivity extends BaseFragment {
|
||||
@Override
|
||||
public void onItemClick(final AdapterView<?> adapterView, View view, final int i, long l) {
|
||||
if (i == nameAndStatusRow) {
|
||||
presentFragment(new SettingsNameActivity());
|
||||
presentFragment(new SettingsNameFragment());
|
||||
}
|
||||
else if (i == passcodeRow) {
|
||||
if (UserConfig.passcodeHash.length() > 0) {
|
||||
@@ -156,13 +156,13 @@ public class SettingsActivity extends BaseFragment {
|
||||
}
|
||||
}
|
||||
else if (i == notificationRow) {
|
||||
presentFragment(new SettingsNotificationsActivity());
|
||||
presentFragment(new SettingsNotificationsFragment());
|
||||
}
|
||||
else if (i == backgroundRow) {
|
||||
presentFragment(new WallpapersActivity());
|
||||
}
|
||||
else if (i == advRow) {
|
||||
presentFragment(new SettingsAdvActivity());
|
||||
presentFragment(new SettingsAdvFragment());
|
||||
}
|
||||
else if (i == aboutRow ) {
|
||||
Intent intent2 = new Intent(getParentActivity(), WelcomeActivity.class);
|
||||
+1
-1
@@ -51,7 +51,7 @@ import com.b44t.ui.Cells.TextInfoCell;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
|
||||
|
||||
public class SettingsNameActivity extends BaseFragment {
|
||||
public class SettingsNameFragment extends BaseFragment {
|
||||
|
||||
// the list
|
||||
private ListAdapter listAdapter;
|
||||
+1
-1
@@ -56,7 +56,7 @@ import com.b44t.ui.Cells.TextSettingsCell;
|
||||
import com.b44t.ui.Components.ColorPickerView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
|
||||
public class SettingsNotificationsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
public class SettingsNotificationsFragment extends BaseFragment implements NotificationCenter.NotificationCenterDelegate {
|
||||
|
||||
private ListView listView;
|
||||
|
||||
@@ -35,7 +35,6 @@ import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.PowerManager;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
@@ -306,7 +305,7 @@ public class WelcomeActivity extends Activity implements NotificationCenter.Noti
|
||||
|
||||
|
||||
private void tryToStartImport() {
|
||||
File imexDir = SettingsAdvActivity.getImexDir();
|
||||
File imexDir = SettingsAdvFragment.getImexDir();
|
||||
final String backupFile = MrMailbox.imexHasBackup(imexDir.getAbsolutePath());
|
||||
if (backupFile != null) {
|
||||
new AlertDialog.Builder(this)
|
||||
|
||||
Reference in New Issue
Block a user