Some fixes

This commit is contained in:
tom79 2019-09-25 15:57:13 +02:00
parent a75c7ee327
commit 208a5b8dde
4 changed files with 35 additions and 3 deletions

View File

@ -197,7 +197,7 @@ public abstract class BaseMainActivity extends BaseActivity
public static String regex_home, regex_local, regex_public;
public static boolean show_boosts, show_replies, show_art_nsfw;
enum iconLauncher{
public enum iconLauncher{
BUBBLES,
FEDIVERSE,
HERO,

View File

@ -76,6 +76,7 @@ import java.util.Locale;
import java.util.Set;
import app.fedilab.android.R;
import app.fedilab.android.activities.BaseMainActivity;
import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.activities.SettingsActivity;
import app.fedilab.android.asynctasks.DownloadTrackingDomainsAsyncTask;
@ -106,6 +107,11 @@ import mabbas007.tagsedittext.TagsEditText;
import static android.app.Activity.RESULT_OK;
import static android.content.Context.MODE_PRIVATE;
import static app.fedilab.android.activities.BaseMainActivity.iconLauncher.ATOM;
import static app.fedilab.android.activities.BaseMainActivity.iconLauncher.BRAINCRASH;
import static app.fedilab.android.activities.BaseMainActivity.iconLauncher.BUBBLES;
import static app.fedilab.android.activities.BaseMainActivity.iconLauncher.FEDIVERSE;
import static app.fedilab.android.activities.BaseMainActivity.iconLauncher.HERO;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.ADMIN;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.COMPOSE;
import static app.fedilab.android.fragments.ContentSettingsFragment.type.INTERFACE;
@ -2436,6 +2442,7 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
ImageButton btn_select_icon = rootView.findViewById(R.id.btn_select_icon);
btn_select_icon.setOnClickListener(v -> {
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, style);
View icon_selector = inflater.inflate(R.layout.dialog_icon_selector, null);
dialogBuilder.setView(icon_selector);
@ -2452,30 +2459,53 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
icon_selector.findViewById(R.id.icon_bubbles).setOnClickListener(v1 -> {
hideAllIcons(context);
setIcon(context,"Bubbles");
SharedPreferences.Editor editor2 = sharedpreferences.edit();
editor2 = sharedpreferences.edit();
editor2.putString(Helper.LOGO_LAUNCHER, "bubbles");
editor2.apply();
BaseMainActivity.mLauncher = BUBBLES;
icon_selector_dialog.dismiss();
});
icon_selector.findViewById(R.id.icon_fediverse).setOnClickListener(v1 -> {
hideAllIcons(context);
setIcon(context,"Fediverse");
SharedPreferences.Editor editor2 = sharedpreferences.edit();
editor2 = sharedpreferences.edit();
editor2.putString(Helper.LOGO_LAUNCHER, "fediverse");
editor2.apply();
BaseMainActivity.mLauncher = FEDIVERSE;
icon_selector_dialog.dismiss();
});
icon_selector.findViewById(R.id.icon_hero).setOnClickListener(v1 -> {
hideAllIcons(context);
setIcon(context,"Hero");
SharedPreferences.Editor editor2 = sharedpreferences.edit();
editor2 = sharedpreferences.edit();
editor2.putString(Helper.LOGO_LAUNCHER, "hero");
editor2.apply();
BaseMainActivity.mLauncher = HERO;
icon_selector_dialog.dismiss();
});
icon_selector.findViewById(R.id.icon_atom).setOnClickListener(v1 -> {
hideAllIcons(context);
setIcon(context,"Atom");
SharedPreferences.Editor editor2 = sharedpreferences.edit();
editor2.putString(Helper.LOGO_LAUNCHER, "atom");
editor2.apply();
BaseMainActivity.mLauncher = ATOM;
icon_selector_dialog.dismiss();
});
icon_selector.findViewById(R.id.icon_braincrash).setOnClickListener(v1 -> {
hideAllIcons(context);
setIcon(context,"BrainCrash");
SharedPreferences.Editor editor2 = sharedpreferences.edit();
editor2.putString(Helper.LOGO_LAUNCHER, "braincrash");
editor2.apply();
BaseMainActivity.mLauncher = BRAINCRASH;
icon_selector_dialog.dismiss();
});

View File

@ -2156,7 +2156,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Change app icon (Experimental)"
android:text="@string/change_app_icon_experimental"
android:textSize="16sp" />
<ImageButton
@ -2165,7 +2165,7 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="20dp"
android:contentDescription="Click to change the app icon (Not recommended)"
android:contentDescription="@string/click_to_change_the_app_icon"
android:padding="5dp"
android:src="@drawable/ic_all_inclusive_menu" />
</LinearLayout>

View File

@ -1224,4 +1224,6 @@
<string name="set_resize_picture_indication">Allow to compress large photos into smaller sized photos with very less or negligible loss in quality of the image.</string>
<string name="set_resize_video_indication">Allow compressing videos while maintaining their quality.</string>
<string name="please_wait_compression">The app is compressing the media, it can be quite long…</string>
<string name="change_app_icon_experimental">Change app icon</string>
<string name="click_to_change_the_app_icon">Click to change the app icon</string>
</resources>