diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/SetSettingsActivity.java | 13 | ||||
-rw-r--r-- | src/main/res/layout/activity_set_settings.xml | 29 | ||||
-rw-r--r-- | src/main/res/values/defaults.xml | 2 |
3 files changed, 43 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/SetSettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SetSettingsActivity.java index 1b04924d9..764ec0ce7 100644 --- a/src/main/java/de/pixart/messenger/ui/SetSettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SetSettingsActivity.java @@ -24,6 +24,7 @@ import static de.pixart.messenger.ui.SettingsActivity.CONFIRM_MESSAGES; import static de.pixart.messenger.ui.SettingsActivity.FORBID_SCREENSHOTS; import static de.pixart.messenger.ui.SettingsActivity.SHOW_LINKS_INSIDE; import static de.pixart.messenger.ui.SettingsActivity.SHOW_MAPS_INSIDE; +import static de.pixart.messenger.ui.SettingsActivity.USE_INVIDIOUS; public class SetSettingsActivity extends XmppActivity implements XmppConnectionService.OnAccountUpdate { ActivitySetSettingsBinding binding; @@ -34,6 +35,7 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS static final int CHATSTATES = 4; static final int CONFIRMMESSAGES = 5; static final int LASTSEEN = 6; + static final int INVIDEOUS = 7; @Override protected void refreshUiReal() { @@ -63,6 +65,7 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS this.binding.actionInfoChatStates.setOnClickListener(string -> showInfo(CHATSTATES)); this.binding.actionInfoConfirmMessages.setOnClickListener(string -> showInfo(CONFIRMMESSAGES)); this.binding.actionInfoLastSeen.setOnClickListener(string -> showInfo(LASTSEEN)); + this.binding.actionInfoInvideous.setOnClickListener(string -> showInfo(INVIDEOUS)); } private void getDefaults() { @@ -72,6 +75,7 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS this.binding.chatStates.setChecked(getResources().getBoolean(R.bool.chat_states)); this.binding.confirmMessages.setChecked(getResources().getBoolean(R.bool.confirm_messages)); this.binding.lastSeen.setChecked(getResources().getBoolean(R.bool.last_activity)); + this.binding.invideous.setChecked(getResources().getBoolean(R.bool.use_invidious)); } private void next(View view) { @@ -117,6 +121,10 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS title = getString(R.string.pref_broadcast_last_activity); message = getString(R.string.pref_broadcast_last_activity_summary); break; + case INVIDEOUS: + title = getString(R.string.pref_use_invidious); + message = getString(R.string.pref_use_invidious_summary); + break; default: title = getString(R.string.error); message = getString(R.string.error); @@ -162,6 +170,11 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS } else { preferences.edit().putBoolean(BROADCAST_LAST_ACTIVITY, false).apply(); } + if (this.binding.invideous.isChecked()) { + preferences.edit().putBoolean(USE_INVIDIOUS, true).apply(); + } else { + preferences.edit().putBoolean(USE_INVIDIOUS, false).apply(); + } } @Override diff --git a/src/main/res/layout/activity_set_settings.xml b/src/main/res/layout/activity_set_settings.xml index 313092c41..7197fb19a 100644 --- a/src/main/res/layout/activity_set_settings.xml +++ b/src/main/res/layout/activity_set_settings.xml @@ -220,6 +220,35 @@ android:layout_height="match_parent" android:gravity="center_vertical" /> </TableRow> + <TableRow + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:paddingBottom="@dimen/card_padding_regular"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:ellipsize="end" + android:gravity="center_vertical" + android:text="@string/pref_use_invidious" + android:textAppearance="@style/TextAppearance.Conversations.Body1" /> + + <ImageButton + android:id="@+id/action_info_invideous" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:alpha="?attr/icon_alpha" + android:background="?attr/selectableItemBackgroundBorderless" + android:gravity="center_vertical" + android:padding="@dimen/image_button_padding" + android:src="@drawable/ic_help_circle_outline_black_24dp" /> + + <androidx.appcompat.widget.AppCompatCheckBox + android:id="@+id/invideous" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:gravity="center_vertical" /> + </TableRow> </TableLayout> </LinearLayout> diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml index 69d40d15e..5eeeded31 100644 --- a/src/main/res/values/defaults.xml +++ b/src/main/res/values/defaults.xml @@ -86,7 +86,7 @@ <bool name="use_max_brightness">true</bool> <bool name="auto_rotate">true</bool> <bool name="send_crashreport">true</bool> - <bool name="use_invidious">true</bool> + <bool name="use_invidious">false</bool> <bool name="plain_text_logs">false</bool> <bool name="validate_hostname">false</bool> <bool name="show_foreground_service">true</bool> |