Remove previous settings migrate to new ones

This commit is contained in:
tom79 2019-07-02 19:00:48 +02:00
parent 4cc5a99b71
commit 5f7c20e97a
13 changed files with 2299 additions and 5064 deletions

View File

@ -50,7 +50,6 @@ import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import android.util.Patterns;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -74,11 +73,8 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import app.fedilab.android.BuildConfig;
import app.fedilab.android.asynctasks.PostAdminActionAsyncTask;
import app.fedilab.android.client.API;
import app.fedilab.android.client.APIResponse;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.AdminAction;
import app.fedilab.android.client.Entities.Filters;
import app.fedilab.android.client.Entities.ManageTimelines;
import app.fedilab.android.client.Entities.Results;
@ -86,7 +82,6 @@ import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.TagTimeline;
import app.fedilab.android.client.Entities.Version;
import app.fedilab.android.fragments.DisplayAccountsFragment;
import app.fedilab.android.fragments.DisplayAdminReportsFragment;
import app.fedilab.android.fragments.DisplayBookmarksFragment;
import app.fedilab.android.fragments.DisplayDraftsFragment;
import app.fedilab.android.fragments.DisplayFavoritesPeertubeFragment;
@ -102,12 +97,10 @@ import app.fedilab.android.fragments.DisplayStatusFragment;
import app.fedilab.android.fragments.SettingsPeertubeFragment;
import app.fedilab.android.fragments.TabLayoutNotificationsFragment;
import app.fedilab.android.fragments.TabLayoutScheduleFragment;
import app.fedilab.android.fragments.TabLayoutSettingsFragment;
import app.fedilab.android.fragments.WhoToFollowFragment;
import app.fedilab.android.helper.CrossActions;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.helper.MenuFloating;
import app.fedilab.android.interfaces.OnAdminActionInterface;
import app.fedilab.android.services.BackupStatusService;
import app.fedilab.android.services.LiveNotificationService;
import app.fedilab.android.sqlite.AccountDAO;

View File

@ -46,6 +46,7 @@ import app.fedilab.android.animatemenu.interfaces.Resourceble;
import app.fedilab.android.animatemenu.interfaces.ScreenShotable;
import app.fedilab.android.animatemenu.model.SlideMenuItem;
import app.fedilab.android.animatemenu.util.ViewAnimator;
import app.fedilab.android.asynctasks.UpdateAccountInfoAsyncTask;
import app.fedilab.android.fragments.ContentSettingsFragment;
import app.fedilab.android.helper.Helper;
@ -169,8 +170,10 @@ public class SettingsActivity extends BaseActivity implements ViewAnimator.ViewA
list.add(menuItem0);
SlideMenuItem menuItem1 = new SlideMenuItem(ContentSettingsFragment.type.TIMELINES, R.drawable.ic_timeline_menu_s);
list.add(menuItem1);
SlideMenuItem menuItem2 = new SlideMenuItem(ContentSettingsFragment.type.ADMIN, R.drawable.ic_security_admin_menu);
list.add(menuItem2);
if( MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA){
SlideMenuItem menuItem2 = new SlideMenuItem(ContentSettingsFragment.type.ADMIN, R.drawable.ic_security_admin_menu);
list.add(menuItem2);
}
SlideMenuItem menuItem3 = new SlideMenuItem(ContentSettingsFragment.type.NOTIFICATIONS, R.drawable.ic_notifications_menu);
list.add(menuItem3);
SlideMenuItem menuItem4 = new SlideMenuItem(ContentSettingsFragment.type.INTERFACE, R.drawable.ic_tablet_menu);

View File

@ -1,516 +0,0 @@
package app.fedilab.android.fragments;
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.appcompat.widget.SwitchCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import app.fedilab.android.helper.Helper;
import es.dmoral.toasty.Toasty;
import app.fedilab.android.R;
import static android.app.Activity.RESULT_OK;
/**
* Created by Thomas on 29/04/2017.
* Fragment for settings, yes I didn't use PreferenceFragment :)
*/
public class SettingsNotificationsFragment extends Fragment {
private Context context;
private int style;
private static final int ACTIVITY_CHOOSE_SOUND = 412;
int count = 0;
int count1 = 0;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_settings_notifications, container, false);
context = getContext();
assert context != null;
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_DARK){
style = R.style.DialogDark;
}else {
style = R.style.Dialog;
}
boolean notify = sharedpreferences.getBoolean(Helper.SET_NOTIFY, true);
final SwitchCompat switchCompatNotify = rootView.findViewById(R.id.set_notify);
switchCompatNotify.setChecked(notify);
final LinearLayout notification_settings = rootView.findViewById(R.id.notification_settings);
if( notify)
notification_settings.setVisibility(View.VISIBLE);
else
notification_settings.setVisibility(View.GONE);
switchCompatNotify.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Save the state here
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIFY, isChecked);
editor.apply();
if( isChecked)
notification_settings.setVisibility(View.VISIBLE);
else
notification_settings.setVisibility(View.GONE);
}
});
boolean notif_follow = sharedpreferences.getBoolean(Helper.SET_NOTIF_FOLLOW, true);
boolean notif_add = sharedpreferences.getBoolean(Helper.SET_NOTIF_ADD, true);
boolean notif_ask = sharedpreferences.getBoolean(Helper.SET_NOTIF_ASK, true);
boolean notif_mention = sharedpreferences.getBoolean(Helper.SET_NOTIF_MENTION, true);
boolean notif_share = sharedpreferences.getBoolean(Helper.SET_NOTIF_SHARE, true);
boolean notif_poll = sharedpreferences.getBoolean(Helper.SET_NOTIF_POLL, true);
boolean notif_wifi = sharedpreferences.getBoolean(Helper.SET_WIFI_ONLY, false);
boolean notif_silent = sharedpreferences.getBoolean(Helper.SET_NOTIF_SILENT, false);
boolean notif_hometimeline = sharedpreferences.getBoolean(Helper.SET_NOTIF_HOMETIMELINE, false);
final String time_from = sharedpreferences.getString(Helper.SET_TIME_FROM, "07:00");
final String time_to = sharedpreferences.getString(Helper.SET_TIME_TO, "22:00");
final CheckBox set_notif_follow = rootView.findViewById(R.id.set_notif_follow);
final CheckBox set_notif_follow_add = rootView.findViewById(R.id.set_notif_follow_add);
final CheckBox set_notif_follow_ask = rootView.findViewById(R.id.set_notif_follow_ask);
final CheckBox set_notif_follow_mention = rootView.findViewById(R.id.set_notif_follow_mention);
final CheckBox set_notif_follow_share = rootView.findViewById(R.id.set_notif_follow_share);
final CheckBox set_notif_follow_poll = rootView.findViewById(R.id.set_notif_follow_poll);
final CheckBox set_notif_hometimeline = rootView.findViewById(R.id.set_notif_hometimeline);
final SwitchCompat switchCompatWIFI = rootView.findViewById(R.id.set_wifi_only);
final SwitchCompat switchCompatSilent = rootView.findViewById(R.id.set_silence);
final Button settings_time_from = rootView.findViewById(R.id.settings_time_from);
final Button settings_time_to = rootView.findViewById(R.id.settings_time_to);
final LinearLayout channels_container = rootView.findViewById(R.id.channels_container);
final Button sound_boost = rootView.findViewById(R.id.sound_boost);
final Button sound_fav = rootView.findViewById(R.id.sound_fav);
final Button sound_follow = rootView.findViewById(R.id.sound_follow);
final Button sound_mention = rootView.findViewById(R.id.sound_mention);
final Button sound_poll = rootView.findViewById(R.id.sound_poll);
final Button sound_backup = rootView.findViewById(R.id.sound_backup);
final Button sound_media = rootView.findViewById(R.id.sound_media);
Button set_notif_sound = rootView.findViewById(R.id.set_notif_sound);
settings_time_from.setText(time_from);
settings_time_to.setText(time_to);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
set_notif_sound.setVisibility(View.GONE);
channels_container.setVisibility(View.VISIBLE);
sound_boost.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_boost");
startActivity(intent);
}
});
sound_fav.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_fav");
startActivity(intent);
}
});
sound_follow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_follow");
startActivity(intent);
}
});
sound_mention.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_mention");
startActivity(intent);
}
});
sound_poll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_poll");
startActivity(intent);
}
});
sound_backup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_backup");
startActivity(intent);
}
});
sound_media.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
intent.putExtra(Settings.EXTRA_CHANNEL_ID, "channel_store");
startActivity(intent);
}
});
}else{
set_notif_sound.setVisibility(View.VISIBLE);
channels_container.setVisibility(View.GONE);
set_notif_sound.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, context.getString(R.string.select_sound));
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
startActivityForResult(intent, ACTIVITY_CHOOSE_SOUND);
}
});
}
boolean enable_time_slot = sharedpreferences.getBoolean(Helper.SET_ENABLE_TIME_SLOT, true);
final CheckBox set_enable_time_slot = rootView.findViewById(R.id.set_enable_time_slot);
set_enable_time_slot.setChecked(enable_time_slot);
set_enable_time_slot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_ENABLE_TIME_SLOT, set_enable_time_slot.isChecked());
editor.apply();
}
});
settings_time_from.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String[] datetime = time_from.split(":");
TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity(), style, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
SharedPreferences.Editor editor = sharedpreferences.edit();
String hours = (String.valueOf(hourOfDay).length() == 1) ? "0"+String.valueOf(hourOfDay):String.valueOf(hourOfDay);
String minutes = (String.valueOf(minute).length() == 1) ? "0"+String.valueOf(minute):String.valueOf(minute);
String newDate = hours + ":" + minutes;
if( Helper.compareDate(context, newDate, false) ) {
editor.putString(Helper.SET_TIME_FROM, newDate);
editor.apply();
settings_time_from.setText(newDate);
}else {
String ateRef = sharedpreferences.getString(Helper.SET_TIME_TO, "22:00");
Toasty.error(context, context.getString(R.string.settings_time_lower, ateRef), Toast.LENGTH_LONG).show();
}
}
}, Integer.valueOf(datetime[0]), Integer.valueOf(datetime[1]), true);
timePickerDialog.setTitle(context.getString(R.string.settings_hour_init));
timePickerDialog.show();
}
});
settings_time_to.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String[] datetime = time_to.split(":");
TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity(),style, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
SharedPreferences.Editor editor = sharedpreferences.edit();
String hours = (String.valueOf(hourOfDay).length() == 1) ? "0" + String.valueOf(hourOfDay) : String.valueOf(hourOfDay);
String minutes = (String.valueOf(minute).length() == 1) ? "0" + String.valueOf(minute) : String.valueOf(minute);
String newDate = hours + ":" + minutes;
if (Helper.compareDate(context, newDate, true)) {
editor.putString(Helper.SET_TIME_TO, newDate);
editor.apply();
settings_time_to.setText(newDate);
} else {
String ateRef = sharedpreferences.getString(Helper.SET_TIME_FROM, "07:00");
Toasty.error(context, context.getString(R.string.settings_time_greater, ateRef), Toast.LENGTH_LONG).show();
}
}
}, Integer.valueOf(datetime[0]), Integer.valueOf(datetime[1]), true);
timePickerDialog.setTitle(context.getString(R.string.settings_hour_end));
timePickerDialog.show();
}
});
final Spinner action_notification = rootView.findViewById(R.id.action_notification);
ArrayAdapter<CharSequence> adapterAction = ArrayAdapter.createFromResource(getContext(),
R.array.action_notification, android.R.layout.simple_spinner_item);
action_notification.setAdapter(adapterAction);
int positionNotificationAntion;
switch (sharedpreferences.getInt(Helper.SET_NOTIFICATION_ACTION, Helper.ACTION_ACTIVE)){
case Helper.ACTION_ACTIVE:
positionNotificationAntion = 0;
break;
case Helper.ACTION_SILENT:
positionNotificationAntion = 1;
break;
default:
positionNotificationAntion = 0;
}
action_notification.setSelection(positionNotificationAntion);
action_notification.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if( count1 > 0 ) {
SharedPreferences.Editor editor = sharedpreferences.edit();
switch (position) {
case 0:
editor.putInt(Helper.SET_NOTIFICATION_ACTION, Helper.ACTION_ACTIVE);
editor.apply();
break;
case 1:
editor.putInt(Helper.SET_NOTIFICATION_ACTION, Helper.ACTION_SILENT);
editor.apply();
break;
}
}
count1++;
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
set_notif_follow.setChecked(notif_follow);
set_notif_follow_add.setChecked(notif_add);
set_notif_follow_ask.setChecked(notif_ask);
set_notif_follow_mention.setChecked(notif_mention);
set_notif_follow_share.setChecked(notif_share);
set_notif_follow_poll.setChecked(notif_poll);
set_notif_hometimeline.setChecked(notif_hometimeline);
switchCompatWIFI.setChecked(notif_wifi);
switchCompatSilent.setChecked(notif_silent);
set_notif_hometimeline.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_HOMETIMELINE, set_notif_hometimeline.isChecked());
editor.apply();
}
});
set_notif_follow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_FOLLOW, set_notif_follow.isChecked());
editor.apply();
}
});
set_notif_follow_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_ADD, set_notif_follow_add.isChecked());
editor.apply();
}
});
set_notif_follow_ask.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_ASK, set_notif_follow_ask.isChecked());
editor.apply();
}
});
set_notif_follow_mention.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_MENTION, set_notif_follow_mention.isChecked());
editor.apply();
}
});
set_notif_follow_share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_SHARE, set_notif_follow_share.isChecked());
editor.apply();
}
});
set_notif_follow_poll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_POLL, set_notif_follow_poll.isChecked());
editor.apply();
}
});
switchCompatWIFI.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Save the state here
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_WIFI_ONLY, isChecked);
editor.apply();
}
});
final Spinner led_colour_spinner = rootView.findViewById(R.id.led_colour_spinner);
final TextView ledLabel = rootView.findViewById(R.id.set_led_colour_label);
switchCompatSilent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Save the state here
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_NOTIF_SILENT, isChecked);
editor.apply();
if (isChecked) {
ledLabel.setEnabled(true);
led_colour_spinner.setEnabled(true);
} else {
ledLabel.setEnabled(false);
for (View lol : led_colour_spinner.getTouchables()) {
lol.setEnabled(false);
}
}
}
});
if (sharedpreferences.getBoolean(Helper.SET_NOTIF_SILENT, false)) {
ledLabel.setEnabled(true);
led_colour_spinner.setEnabled(true);
ArrayAdapter<CharSequence> adapterLEDColour = ArrayAdapter.createFromResource(getContext(), R.array.led_colours, android.R.layout.simple_spinner_item);
led_colour_spinner.setAdapter(adapterLEDColour);
int positionSpinnerLEDColour = (sharedpreferences.getInt(Helper.SET_LED_COLOUR, Helper.LED_COLOUR));
led_colour_spinner.setSelection(positionSpinnerLEDColour);
led_colour_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (count > 0) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_LED_COLOUR, position);
editor.apply();
} else {
count++;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
else {
ledLabel.setEnabled(false);
for (View lol : led_colour_spinner.getTouchables()) {
lol.setEnabled(false);
}
}
return rootView;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != RESULT_OK) return;
if (requestCode == ACTIVITY_CHOOSE_SOUND){
try{
Uri uri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Helper.SET_NOTIF_SOUND, uri.toString());
editor.apply();
}catch (Exception e){
Toasty.error(context, context.getString(R.string.toast_error),Toast.LENGTH_LONG).show();
}
}
}
@Override
public void onCreate(Bundle saveInstance) {
super.onCreate(saveInstance);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.context = context;
}
}

View File

@ -1,228 +0,0 @@
package app.fedilab.android.fragments;
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity;
/**
* Created by Thomas on 25/04/2017.
* Fragment for settings, yes I didn't use PreferenceFragment :)
*/
public class SettingsOptimizationFragment extends Fragment {
private Context context;
int count = 0;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_settings_optimization, container, false);
context = getContext();
assert context != null;
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
//Translators
final Spinner battery_layout_spinner = rootView.findViewById(R.id.battery_layout_spinner);
ArrayAdapter<CharSequence> adapterTrans = ArrayAdapter.createFromResource(getContext(),
R.array.battery_profiles, android.R.layout.simple_spinner_item);
battery_layout_spinner.setAdapter(adapterTrans);
int positionSpinner = sharedpreferences.getInt(Helper.SET_BATTERY_PROFILE, Helper.BATTERY_PROFILE_NORMAL) -1;
battery_layout_spinner.setSelection(positionSpinner);
battery_layout_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if( count > 0){
SharedPreferences.Editor editor = sharedpreferences.edit();
switch (position){
case 0:
editor.putInt(Helper.SET_BATTERY_PROFILE, Helper.BATTERY_PROFILE_NORMAL);
editor.apply();
break;
case 1:
editor.putInt(Helper.SET_BATTERY_PROFILE, Helper.BATTERY_PROFILE_MEDIUM);
editor.apply();
break;
case 2:
editor.putInt(Helper.SET_BATTERY_PROFILE, Helper.BATTERY_PROFILE_LOW);
editor.apply();
break;
}
Helper.changeBatteryProfile(context);
if( position < 2 ){
try {
((MainActivity) context).startSreaming();
}catch (Exception ignored){ignored.printStackTrace();}
}else{
context.sendBroadcast(new Intent("StopLiveNotificationService"));
}
}else {
count++;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//Status per page
SeekBar statusSeekBar = rootView.findViewById(R.id.set_toots_per_page);
final TextView set_toots_page_value = rootView.findViewById(R.id.set_toots_page_value);
statusSeekBar.setMax(30);
int tootPerPage = sharedpreferences.getInt(Helper.SET_TOOTS_PER_PAGE, 40);
statusSeekBar.setProgress(tootPerPage-10);
set_toots_page_value.setText(String.valueOf(tootPerPage));
statusSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int value = 10 + progress;
set_toots_page_value.setText(String.valueOf(value));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_TOOTS_PER_PAGE, value);
editor.apply();
}
});
//Accounts per page
SeekBar accountsSeekBar = rootView.findViewById(R.id.set_accounts_per_page);
final TextView set_accounts_page_value = rootView.findViewById(R.id.set_accounts_page_value);
accountsSeekBar.setMax(30);
int accountsPerPage = sharedpreferences.getInt(Helper.SET_ACCOUNTS_PER_PAGE, 40);
accountsSeekBar.setProgress(accountsPerPage-10);
set_accounts_page_value.setText(String.valueOf(accountsPerPage));
accountsSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int value = 10 + progress;
set_accounts_page_value.setText(String.valueOf(value));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_ACCOUNTS_PER_PAGE, value);
editor.apply();
}
});
//Notifications per page
SeekBar notificationsSeekBar = rootView.findViewById(R.id.set_notifications_per_page);
final TextView set_notifications_page_value = rootView.findViewById(R.id.set_notifications_page_value);
notificationsSeekBar.setMax(20);
int notificationsPerPage = sharedpreferences.getInt(Helper.SET_NOTIFICATIONS_PER_PAGE, 15);
notificationsSeekBar.setProgress(notificationsPerPage-10);
set_notifications_page_value.setText(String.valueOf(notificationsPerPage));
notificationsSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int value = 10 + progress;
set_notifications_page_value.setText(String.valueOf(value));
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_NOTIFICATIONS_PER_PAGE, value);
editor.apply();
}
});
//Manage download of attachments
RadioGroup radioGroup = rootView.findViewById(R.id.set_attachment_group);
int attachmentAction = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
switch (attachmentAction){
case Helper.ATTACHMENT_ALWAYS:
radioGroup.check(R.id.set_attachment_always);
break;
case Helper.ATTACHMENT_WIFI:
radioGroup.check(R.id.set_attachment_wifi);
break;
case Helper.ATTACHMENT_ASK:
radioGroup.check(R.id.set_attachment_ask);
break;
}
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch(checkedId) {
case R.id.set_attachment_always:
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
editor.apply();
break;
case R.id.set_attachment_wifi:
editor = sharedpreferences.edit();
editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_WIFI);
editor.apply();
break;
case R.id.set_attachment_ask:
editor = sharedpreferences.edit();
editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ASK);
editor.apply();
break;
}
}
});
return rootView;
}
@Override
public void onCreate(Bundle saveInstance) {
super.onCreate(saveInstance);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.context = context;
}
}

View File

@ -1,100 +0,0 @@
package app.fedilab.android.fragments;
/* Copyright 2017 Thomas Schneider
*
* This file is a part of Fedilab
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import app.fedilab.android.R;
/**
* Created by Thomas on 29/04/2017.
* Tablayout selection for settings
*/
public class TabLayoutSettingsFragment extends Fragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.tablayout_settings, container, false);
TabLayout tabLayout = inflatedView.findViewById(R.id.tabLayout);
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.settings)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.notifications)));
final ViewPager viewPager = inflatedView.findViewById(R.id.viewpager);
viewPager.setAdapter(new PagerAdapter
(getChildFragmentManager(), tabLayout.getTabCount()));
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
viewPager.setOffscreenPageLimit(2);
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
return inflatedView;
}
/**
* Page Adapter for settings
*/
private class PagerAdapter extends FragmentStatePagerAdapter {
int mNumOfTabs;
private PagerAdapter(FragmentManager fm, int NumOfTabs) {
super(fm);
this.mNumOfTabs = NumOfTabs;
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new SettingsFragment();
case 1:
return new SettingsNotificationsFragment();
default:
return new SettingsNotificationsFragment();
}
}
@Override
public int getCount() {
return mNumOfTabs;
}
}
}

View File

@ -1,941 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:TagsEditText="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipeContainer"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_confirmations"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_share_validation"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_validation"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_share_validation_fav"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_validation_fav"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_timelines"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_remember_position"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_remember_position"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_old_direct_timeline"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_old_direct_timeline"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_hide_delete_notification_on_tab"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_hide_delete_notification_on_tab"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_blur_sensitive"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_blur_sensitive"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_long_press_media"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_long_press_media"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_timeline_in_list"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_timeline_in_list"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_news"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_news_from_fedilab"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/admin_container">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/administration"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_display_admin_menu"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_admin_menu"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_admin_statuses"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_admin_toot"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_notification"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- LIVE NOTIFICATIONS SETTINGS -->
<CheckBox
android:id="@+id/set_live_notify"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/live_notif"
android:layout_height="wrap_content" />
<!-- BACKGROUND PROCESS SETTINGS -->
<CheckBox
android:id="@+id/set_keep_background_process"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_keep_background_process"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_interface"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- COMPACT MODE -->
<TextView
android:text="@string/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_normal_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_normal"
/>
<RadioButton android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_compact"
/>
<RadioButton android:id="@+id/set_console_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_console"
/>
</RadioGroup>
<!-- DISPLAY NEW BADGE -->
<CheckBox
android:id="@+id/set_display_new_badge"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_new_badge"
android:layout_height="wrap_content" />
<!-- DISPLAY FEDILAB FEATURES BUTTON -->
<CheckBox
android:id="@+id/set_display_fedilab_features_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_fedilab_features_button" />
<!-- DISPLAY BOOKMARK BUTTON -->
<CheckBox
android:id="@+id/set_display_bookmarks"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_bookmark_button"
android:layout_height="wrap_content" />
<!-- DISPLAY BOT ICON -->
<CheckBox
android:id="@+id/set_display_bot_icon"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_bot_icon"
android:layout_height="wrap_content" />
<!-- DISPLAY BOT ICON -->
<CheckBox
android:id="@+id/set_quick_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_quick_reply" />
<!-- FIT PREVIEWS -->
<CheckBox
android:id="@+id/set_fit_preview"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_fit_preview"
android:layout_height="wrap_content" />
<!-- GIF AVATARS -->
<CheckBox
android:id="@+id/set_disable_gif"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_disable_gif"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_card"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_card"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_video_preview"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_video_preview"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_content_after_fetch_more"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_content_after_fetch_more"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_composing"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_auto_add_media_url"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_auto_add_media_url"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_auto_store"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_auto_store_toot"
android:layout_height="wrap_content" />
<!-- CARRIAGE RETURN AFTER MENTION IN REPLIES -->
<CheckBox
android:id="@+id/set_capitalize"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_capitalize"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_automatically_split_toot"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_automatically_split_toot"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:id="@+id/set_split_container"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_split_text"
android:gravity="end"
android:layout_width="50dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_split_size"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<CheckBox
android:id="@+id/set_display_emoji"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_emoji"
android:layout_height="wrap_content" />
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
<CheckBox
android:id="@+id/set_share_details"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_details"
android:layout_height="wrap_content" />
<!-- RETRIEVE METADATA -->
<CheckBox
android:id="@+id/set_retrieve_metadata_share_from_extras"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_retrieve_metadata_share_from_extras"
android:layout_height="wrap_content" />
<!-- CUSTOM SHARING -->
<CheckBox
android:id="@+id/set_custom_sharing"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/settings_title_custom_sharing"
android:layout_height="wrap_content" />
<!-- ADD TAGS -->
<CheckBox
android:id="@+id/set_forward_tags"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_forward_tags"
android:layout_height="wrap_content" />
<EditText
android:hint="@string/settings_custom_sharing_url"
android:id="@+id/custom_sharing_url"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_photo_editor"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_photo_editor"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_hiddencontent"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- EXPAND CW -->
<CheckBox
android:id="@+id/set_expand_cw"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/expand_cw"
android:layout_height="wrap_content" />
<!-- EXPAND Images -->
<CheckBox
android:id="@+id/set_expand_image"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/expand_image"
android:layout_height="wrap_content" />
<!-- OPTIMIZATION SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/optimization"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<TextView
android:text="@string/settings_title_battery"
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/battery_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/set_attachment_action"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_attachment_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_attachment_always"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_always"
/>
<RadioButton android:id="@+id/set_attachment_wifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_wifi"
/>
<RadioButton android:id="@+id/set_attachment_ask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_ask"
/>
</RadioGroup>
<CheckBox
android:id="@+id/set_optimize_loading"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_optimize_loading"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_security_provider"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_security_provider"
android:layout_height="wrap_content" />
<!-- Choose stream -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_video_mode"/>
<Spinner
android:id="@+id/set_video_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- Featured tags -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:labelFor="@+id/set_featured_tags"
android:text="@string/featured_hashtags"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<mabbas007.tagsedittext.TagsEditText
android:id="@+id/set_featured_tags"
android:layout_width="match_parent"
android:minLines="3"
android:lines="3"
android:layout_height="wrap_content"
TagsEditText:allowSpaceInTag="true"
TagsEditText:tagsCloseImageRight="@drawable/tag_close"
TagsEditText:tagsTextColor="?colorAccent"
TagsEditText:tagsTextSize="@dimen/defaultTagsTextSize"
TagsEditText:tagsCloseImagePadding="@dimen/defaultTagsCloseImagePadding"
android:inputType="textMultiLine" />
</LinearLayout>
<!-- TRUNCATE LONG TOOTS -->
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/set_truncate_toot"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_truncate_toots"
android:gravity="end"
android:layout_width="30dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_truncate_size"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Resize pictures -->
<LinearLayout
android:layout_marginTop="10dp"
android:id="@+id/resize_layout_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_resize_picture"/>
<Spinner
android:id="@+id/set_resize_picture"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- Translation engine -->
<LinearLayout
android:layout_marginTop="10dp"
android:id="@+id/translation_layout_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_yandex"/>
<Spinner
android:id="@+id/translation_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/set_trans_forced"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<EditText
android:hint="@string/your_api_key"
android:id="@+id/translation_key"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/file_chooser"
android:layout_marginTop="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:maxLines="1"
android:text="@string/set_folder_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:maxLines="2"
android:textStyle="italic"
android:textColor="?attr/colorAccent"
android:id="@+id/set_folder"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:layout_marginTop="5dp"
android:textSize="12sp"
android:textStyle="italic"
android:text="@string/click_to_change"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<CheckBox
android:layout_marginTop="10dp"
android:id="@+id/set_embedded_browser"
android:layout_width="wrap_content"
android:text="@string/embedded_browser"
android:layout_height="wrap_content" />
<Button
android:gravity="center"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
android:id="@+id/update_tracking_domains"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/update_tracking_domains" />
<CheckBox
android:visibility="gone"
android:layout_marginTop="10dp"
android:id="@+id/set_custom_tabs"
android:layout_width="wrap_content"
android:text="@string/custom_tabs"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/set_javascript_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use_javascript"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_javascript"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/set_cookies_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use_cookies"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_cookies"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_theme"/>
<Spinner
android:id="@+id/set_night_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- TOOTS visibility -->
<LinearLayout
android:id="@+id/toot_visibility_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/toots_visibility_tilte"/>
<ImageButton
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/set_toot_visibility"
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:src="@drawable/ic_public"
android:contentDescription="@string/toot_visibility_tilte" />
</LinearLayout>
<!-- NSFW Timeout -->
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/set_nsfw_timeout"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_nsfw_timeout_value"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_nsfw_timeout"
android:layout_width="300dp"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,170 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipeContainer"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
<!-- OPTIMIZATION SETTINGS -->
<TextView
android:text="@string/settings_title_battery"
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:layout_marginBottom="20dp"
android:id="@+id/battery_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- OPTIMIZATION SETTINGS -->
<TextView
android:text="@string/settings_title_optimisation"
style="?attr/shapeBorder"
android:paddingBottom="10dp"
android:layout_width="match_parent"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content" />
<!-- Toots per page -->
<TextView
android:layout_width="wrap_content"
android:layout_margin="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_toots_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_toots_page_value"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_toots_per_page"
android:layout_width="300dp"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Accounts per page -->
<TextView
android:layout_width="wrap_content"
android:layout_margin="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_accounts_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_accounts_page_value"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_accounts_per_page"
android:layout_width="300dp"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Notifications per page -->
<TextView
android:layout_width="wrap_content"
android:layout_margin="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_notifications_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_notifications_page_value"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_notifications_per_page"
android:layout_width="300dp"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Attachment behavior -->
<TextView
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:text="@string/set_attachment_action"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_attachment_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_attachment_always"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_always"
/>
<RadioButton android:id="@+id/set_attachment_wifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_wifi"
/>
<RadioButton android:id="@+id/set_attachment_ask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_ask"
/>
</RadioGroup>
<!-- MORE OPTIONS SETTINGS -->
<!-- END OPTIMIZATION SETTINGS -->
</LinearLayout>
</ScrollView>

View File

@ -1,954 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:TagsEditText="http://schemas.android.com/apk/res-auto"
android:id="@+id/swipeContainer"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding"
android:layout_marginLeft="@dimen/fab_margin"
android:layout_marginRight="@dimen/fab_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_confirmations"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_share_validation"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_validation"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_share_validation_fav"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_validation_fav"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_timelines"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_remember_position"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_remember_position"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_old_direct_timeline"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_old_direct_timeline"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_hide_delete_notification_on_tab"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_hide_delete_notification_on_tab"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_blur_sensitive"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_blur_sensitive"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_long_press_media"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_long_press_media"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_timeline_in_list"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_timeline_in_list"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_news"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_news_from_fedilab"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/admin_container">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/administration"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_display_admin_menu"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_admin_menu"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_admin_statuses"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_admin_toot"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_notification"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- LIVE NOTIFICATIONS SETTINGS -->
<CheckBox
android:id="@+id/set_live_notify"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/live_notif"
android:layout_height="wrap_content" />
<!-- BACKGROUND PROCESS SETTINGS -->
<CheckBox
android:id="@+id/set_keep_background_process"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_keep_background_process"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_interface"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- COMPACT MODE -->
<TextView
android:text="@string/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_normal_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_normal"
/>
<RadioButton android:id="@+id/set_compact_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_compact"
/>
<RadioButton android:id="@+id/set_console_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_console"
/>
</RadioGroup>
<!-- DISPLAY NEW BADGE -->
<CheckBox
android:id="@+id/set_display_new_badge"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_new_badge"
android:layout_height="wrap_content" />
<!-- DISPLAY FEDILAB FEATURES BUTTON -->
<CheckBox
android:id="@+id/set_display_fedilab_features_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_fedilab_features_button" />
<!-- DISPLAY BOOKMARK BUTTON -->
<CheckBox
android:id="@+id/set_display_bookmarks"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_bookmark_button"
android:layout_height="wrap_content" />
<!-- DISPLAY BOT ICON -->
<CheckBox
android:id="@+id/set_display_bot_icon"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_bot_icon"
android:layout_height="wrap_content" />
<!-- DISPLAY BOT ICON -->
<CheckBox
android:id="@+id/set_quick_reply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_quick_reply" />
<!-- FIT PREVIEWS -->
<CheckBox
android:id="@+id/set_fit_preview"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_fit_preview"
android:layout_height="wrap_content" />
<!-- GIF AVATARS -->
<CheckBox
android:id="@+id/set_disable_gif"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_disable_gif"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_card"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_card"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_video_preview"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_video_preview"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_display_content_after_fetch_more"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_content_after_fetch_more"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_composing"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_auto_add_media_url"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_auto_add_media_url"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_auto_store"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_auto_store_toot"
android:layout_height="wrap_content" />
<!-- CARRIAGE RETURN AFTER MENTION IN REPLIES -->
<CheckBox
android:id="@+id/set_capitalize"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_capitalize"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_automatically_split_toot"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_automatically_split_toot"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:id="@+id/set_split_container"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_split_text"
android:gravity="end"
android:layout_width="50dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_split_size"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<CheckBox
android:id="@+id/set_display_emoji"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_display_emoji"
android:layout_height="wrap_content" />
<!-- PUT THE WHOLE CONTENT WHEN SHARING -->
<CheckBox
android:id="@+id/set_share_details"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_share_details"
android:layout_height="wrap_content" />
<!-- RETRIEVE METADATA -->
<CheckBox
android:id="@+id/set_retrieve_metadata_share_from_extras"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_retrieve_metadata_share_from_extras"
android:layout_height="wrap_content" />
<!-- CUSTOM SHARING -->
<CheckBox
android:id="@+id/set_custom_sharing"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/settings_title_custom_sharing"
android:layout_height="wrap_content" />
<!-- ADD TAGS -->
<CheckBox
android:id="@+id/set_forward_tags"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_forward_tags"
android:layout_height="wrap_content" />
<EditText
android:hint="@string/settings_custom_sharing_url"
android:id="@+id/custom_sharing_url"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_photo_editor"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_photo_editor"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_label_hiddencontent"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- EXPAND CW -->
<CheckBox
android:id="@+id/set_expand_cw"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/expand_cw"
android:layout_height="wrap_content" />
<!-- EXPAND Images -->
<CheckBox
android:id="@+id/set_expand_image"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/expand_image"
android:layout_height="wrap_content" />
<!-- OPTIMIZATION SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/optimization"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<TextView
android:text="@string/settings_title_battery"
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/battery_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/set_attachment_action"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_attachment_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_attachment_always"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_always"
/>
<RadioButton android:id="@+id/set_attachment_wifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_wifi"
/>
<RadioButton android:id="@+id/set_attachment_ask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_ask"
/>
</RadioGroup>
<CheckBox
android:id="@+id/set_optimize_loading"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_optimize_loading"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_security_provider"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_security_provider"
android:layout_height="wrap_content" />
<!-- Choose stream -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_video_mode"/>
<Spinner
android:id="@+id/set_video_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- Featured tags -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:labelFor="@+id/set_featured_tags"
android:text="@string/featured_hashtags"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<mabbas007.tagsedittext.TagsEditText
android:id="@+id/set_featured_tags"
android:layout_width="match_parent"
android:minLines="3"
android:lines="3"
android:layout_height="wrap_content"
TagsEditText:allowSpaceInTag="true"
TagsEditText:tagsCloseImageRight="@drawable/tag_close"
TagsEditText:tagsTextColor="?colorAccent"
TagsEditText:tagsTextSize="@dimen/defaultTagsTextSize"
TagsEditText:tagsCloseImagePadding="@dimen/defaultTagsCloseImagePadding"
android:inputType="textMultiLine" />
</LinearLayout>
<!-- TRUNCATE LONG TOOTS -->
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/set_truncate_toot"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_truncate_toots"
android:gravity="end"
android:layout_width="30dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_truncate_size"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Resize pictures -->
<LinearLayout
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_resize_picture"/>
<Spinner
android:id="@+id/set_resize_picture"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- Translation engine -->
<LinearLayout
android:layout_marginTop="10dp"
android:id="@+id/translation_layout_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_yandex"/>
<Spinner
android:id="@+id/translation_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:id="@+id/set_trans_forced"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<EditText
android:hint="@string/your_api_key"
android:id="@+id/translation_key"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/file_chooser"
android:layout_marginTop="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:maxLines="1"
android:text="@string/set_folder_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:maxLines="2"
android:textStyle="italic"
android:textColor="?attr/colorAccent"
android:id="@+id/set_folder"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:layout_marginTop="5dp"
android:textSize="12sp"
android:textStyle="italic"
android:text="@string/click_to_change"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<CheckBox
android:layout_marginTop="10dp"
android:id="@+id/set_embedded_browser"
android:layout_width="wrap_content"
android:text="@string/embedded_browser"
android:layout_height="wrap_content" />
<Button
android:gravity="center"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
android:id="@+id/update_tracking_domains"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:text="@string/update_tracking_domains" />
<CheckBox
android:visibility="gone"
android:layout_marginTop="10dp"
android:id="@+id/set_custom_tabs"
android:layout_width="wrap_content"
android:text="@string/custom_tabs"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/set_javascript_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use_javascript"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_javascript"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/set_cookies_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use_cookies"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_cookies"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
<!-- THEME -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_theme"/>
<Spinner
android:id="@+id/set_night_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- TOOTS visibility -->
<LinearLayout
android:id="@+id/toot_visibility_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/toots_visibility_tilte"/>
<ImageButton
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:id="@+id/set_toot_visibility"
android:padding="5dp"
android:layout_width="40dp"
android:layout_height="40dp"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:src="@drawable/ic_public"
android:contentDescription="@string/toot_visibility_tilte" />
</LinearLayout>
<!-- NSFW Timeout -->
<TextView
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="@string/set_nsfw_timeout"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_nsfw_timeout_value"
android:layout_gravity="center"
android:layout_width="50dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_nsfw_timeout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,477 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipeContainer"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_notify"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_notify"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/notification_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_customize"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<Button
android:id="@+id/set_notif_sound"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/channels_container"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_mention"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_mention"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_follow"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_follow"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_boost"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_boost"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_fav"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_fav"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_poll"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_poll"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_media"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_media"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_backup"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_backup"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:visibility="invisible"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<!-- NOTIFICATIONS SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_categories"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- Toots per page -->
<CheckBox
android:id="@+id/set_notif_follow"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_add"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_add"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_ask"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_ask"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_mention"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_mention"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_share"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_share"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_poll"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_poll"
android:layout_height="wrap_content" />
<!-- END NOTIFICATIONS SETTINGS -->
<!-- NOTIFICATION CONTENT NEW -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_news"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- New hometimeline content -->
<CheckBox
android:id="@+id/set_notif_hometimeline"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notification_news"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_time_slot"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_enable_time_slot"
android:layout_width="wrap_content"
android:text="@string/set_enable_time_slot"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:layout_height="wrap_content" />
<LinearLayout
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:paddingBottom="10dp"
android:orientation="horizontal">
<TextView
android:text="@string/settings_time_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:focusableInTouchMode="false"
android:id="@+id/settings_time_from"
style="?attr/borderlessColored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/settings_time_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:focusableInTouchMode="false"
style="?attr/borderlessColored"
android:id="@+id/settings_time_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/action_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/action_notification"/>
</LinearLayout>
<!-- MORE OPTIONS SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_advanced"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_wifi_only"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_wifi_only"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_notif_silent"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_silence"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/set_led_colour_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@string/set_led_colour"/>
<Spinner
android:id="@+id/led_colour_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/led_colours"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,174 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Thomas Schneider
This file is a part of Fedilab
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipeContainer"
android:paddingLeft="@dimen/drawer_padding"
android:paddingRight="@dimen/drawer_padding"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="@dimen/fab_margin"
android:paddingRight="@dimen/fab_margin"
android:orientation="vertical"
tools:ignore="UselessParent">
<!-- OPTIMIZATION SETTINGS -->
<TextView
android:text="@string/settings_title_battery"
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:layout_marginBottom="20dp"
android:id="@+id/battery_layout_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!-- OPTIMIZATION SETTINGS -->
<TextView
android:text="@string/settings_title_optimisation"
style="?attr/shapeBorder"
android:layout_marginBottom="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<!-- Toots per page -->
<TextView
android:layout_width="wrap_content"
android:layout_marginBottom="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_toots_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_toots_page_value"
android:gravity="end"
android:layout_width="30dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_toots_per_page"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Accounts per page -->
<TextView
android:layout_width="wrap_content"
android:layout_margin="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_accounts_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_accounts_page_value"
android:gravity="end"
android:layout_width="30dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_accounts_per_page"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Notifications per page -->
<TextView
android:layout_width="wrap_content"
android:layout_margin="10dp"
android:typeface="serif"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textStyle="italic"
android:textSize="14sp"
android:text="@string/set_notifications_page"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<TextView
android:id="@+id/set_notifications_page_value"
android:gravity="end"
android:layout_width="30dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content" />
<SeekBar
android:layout_gravity="center_vertical"
android:id="@+id/set_notifications_per_page"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</SeekBar>
</LinearLayout>
<!-- Attachment behavior -->
<TextView
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:text="@string/set_attachment_action"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RadioGroup
android:id="@+id/set_attachment_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton android:id="@+id/set_attachment_always"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_always"
/>
<RadioButton android:id="@+id/set_attachment_wifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_wifi"
/>
<RadioButton android:id="@+id/set_attachment_ask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_attachment_ask"
/>
</RadioGroup>
<!-- MORE OPTIONS SETTINGS -->
<!-- END OPTIMIZATION SETTINGS -->
</LinearLayout>
</ScrollView>

View File

@ -139,6 +139,445 @@
android:text="@string/set_keep_background_process"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_notify"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_notify"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/notification_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_customize"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<Button
android:id="@+id/set_notif_sound"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/channels_container"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_mention"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_mention"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_follow"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_follow"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_boost"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_boost"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_fav"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_fav"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_poll"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_poll"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/sound_media"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_media"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/sound_backup"
android:gravity="center"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:tint="@android:color/white"
android:text="@string/channel_notif_backup"
android:maxLines="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<Button
android:visibility="invisible"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<!-- NOTIFICATIONS SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_categories"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- Toots per page -->
<CheckBox
android:id="@+id/set_notif_follow"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_add"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_add"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_ask"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_ask"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_mention"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_mention"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_share"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_share"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_notif_follow_poll"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notif_follow_poll"
android:layout_height="wrap_content" />
<!-- END NOTIFICATIONS SETTINGS -->
<!-- NOTIFICATION CONTENT NEW -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_news"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<!-- New hometimeline content -->
<CheckBox
android:id="@+id/set_notif_hometimeline"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:text="@string/set_notification_news"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_time_slot"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<CheckBox
android:id="@+id/set_enable_time_slot"
android:layout_width="wrap_content"
android:text="@string/set_enable_time_slot"
android:layout_marginTop="@dimen/settings_checkbox_margin"
android:layout_marginBottom="@dimen/settings_checkbox_margin"
android:layout_height="wrap_content" />
<LinearLayout
style="?attr/shapeBorder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:paddingBottom="10dp"
android:orientation="horizontal">
<TextView
android:text="@string/settings_time_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:focusableInTouchMode="false"
android:id="@+id/settings_time_from"
style="?attr/borderlessColored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/settings_time_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:focusableInTouchMode="false"
style="?attr/borderlessColored"
android:id="@+id/settings_time_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/action_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/action_notification"/>
</LinearLayout>
<!-- MORE OPTIONS SETTINGS -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/settings_category_notif_advanced"
android:textColor="?colorAccent"
android:textSize="16sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="?colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_wifi_only"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_wifi_only"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/set_notif_silent"/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/set_silence"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/set_led_colour_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:text="@string/set_led_colour"/>
<Spinner
android:id="@+id/led_colour_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/led_colours"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- ADMIN -->