fixed settings opening
This commit is contained in:
@@ -4,7 +4,6 @@ import static ru.vtosters.lite.utils.Preferences.getBoolValue;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
@@ -20,7 +19,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.CacheControl;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.MediaType;
|
||||
@@ -28,7 +26,6 @@ import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
|
||||
public class VTVerifications {
|
||||
public static final HashMap<Integer, Boolean> sServiceAccountsMap = new HashMap<>();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
@@ -9,6 +11,6 @@ public class ActivityFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_activity);
|
||||
addPreferencesFromResource(getIdentifier("preferences_activity", "xml"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -15,7 +17,7 @@ public class FeedFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_feed);
|
||||
addPreferencesFromResource(getIdentifier("preferences_feed", "xml"));
|
||||
prefs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
@@ -9,6 +11,6 @@ public class InstallGMSFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_gms);
|
||||
addPreferencesFromResource(getIdentifier("preferences_gms", "xml"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
@@ -13,7 +14,7 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_interface);
|
||||
addPreferencesFromResource(getIdentifier("preferences_interface", "xml"));
|
||||
prefs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.CacheUtils.deleteCache;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -16,7 +17,7 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_messages);
|
||||
addPreferencesFromResource(getIdentifier("preferences_messages", "xml"));
|
||||
prefs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
@@ -9,6 +11,6 @@ public class MusicFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_music);
|
||||
addPreferencesFromResource(getIdentifier("preferences_music", "xml"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package ru.vtosters.lite.ui.fragments;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.CacheUtils.deleteCache;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserToken;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
import static ru.vtosters.lite.utils.SettBackup.backupSettings;
|
||||
@@ -35,7 +36,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_other);
|
||||
addPreferencesFromResource(getIdentifier("preferences_other", "xml"));
|
||||
prefs();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.vtosters.lite.R;
|
||||
@@ -9,6 +11,6 @@ public class ProxySettingsFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_proxy);
|
||||
addPreferencesFromResource(getIdentifier("preferences_proxy", "xml"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.componentSwitcher;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
|
||||
|
||||
import android.os.Bundle;
|
||||
@@ -19,12 +20,12 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
addPreferencesFromResource(R.xml.preferences_themes);
|
||||
addPreferencesFromResource(getIdentifier("preferences_themes", "xml"));
|
||||
prefs();
|
||||
}
|
||||
|
||||
public boolean apply(Preference preference, Object obj) {
|
||||
if (((Boolean) obj).booleanValue()) {
|
||||
if ((Boolean) obj) {
|
||||
componentSwitcher("VTIconDefault", false);
|
||||
componentSwitcher("VTIconVK", true);
|
||||
} else {
|
||||
|
||||
@@ -129,7 +129,7 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment {
|
||||
super.onCreateOptionsMenu(menu, menuInflater);
|
||||
MenuItem add = menu.add(0, 0, 0, "");
|
||||
add.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||
add.setIcon(getResources().getDrawable(com.vtosters.lite.R.drawable.ic_settings_24));
|
||||
add.setIcon(getResources().getDrawable(getIdentifier("ic_settings_24", "drawable")));
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment {
|
||||
recycler.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
|
||||
|
||||
fab = new FloatingActionButton(container.getContext());
|
||||
fab.setImageResource(R.drawable.ic_add_24);
|
||||
fab.setImageResource(getIdentifier("ic_add_24", "drawable"));
|
||||
fab.setBackgroundTintList(ColorStateList.valueOf(getAccentColor()));
|
||||
fab.setOnClickListener(v2 -> fabClick());
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
|
||||
@@ -344,19 +344,19 @@ public class StickersFragment extends MaterialPreferenceToolbarFragment {
|
||||
if (f.exists()) {
|
||||
holder.stickerImage.setImageURI(Uri.parse("file://" + f.getAbsolutePath()));
|
||||
} else {
|
||||
holder.stickerImage.setImageDrawable(getResources().getDrawable(R.drawable.icon_vk_104));
|
||||
holder.stickerImage.setImageDrawable(getResources().getDrawable(getIdentifier("icon_vk_104", "drawable")));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
holder.updateButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.ic_camera_switch_48)));
|
||||
holder.updateButton.setImageDrawable(recolorDrawable(getResources().getDrawable(getIdentifier("ic_camera_switch_48", "drawable"))));
|
||||
holder.updateButton.setOnClickListener(listener -> {
|
||||
stickersService.setBotKey(TGPref.getTGBotKey());
|
||||
stickersService.requestPackDownload(pack.id, new File(getContext().getFilesDir(), new File("VT-Stickers", pack.id).getAbsolutePath()));
|
||||
});
|
||||
|
||||
holder.deleteButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.vkim_ic_msg_delete)));
|
||||
holder.deleteButton.setImageDrawable(recolorDrawable(getResources().getDrawable(getIdentifier("vkim_ic_msg_delete", "drawable"))));
|
||||
holder.deleteButton.setOnClickListener(listener -> {
|
||||
stickersService.deletePack(pack);
|
||||
notifyItemRemoved(position);
|
||||
|
||||
Reference in New Issue
Block a user