Merge branch 'working' into 'develop'
Allow custom values for auto split See merge request tom79/fedilab!1021
This commit is contained in:
commit
c383d8762e
|
@ -574,10 +574,31 @@ public class SettingsActivity extends BaseActivity {
|
|||
LinearLayout set_split_container = findViewById(R.id.set_split_container);
|
||||
//split size
|
||||
SeekBar split_size = findViewById(R.id.set_split_size);
|
||||
final TextView split_text = findViewById(R.id.set_split_text);
|
||||
final EditText split_text = findViewById(R.id.set_split_text);
|
||||
|
||||
split_size.setProgress(0);
|
||||
split_text.setText(String.valueOf(split_size_val));
|
||||
split_text.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (charSequence != null && charSequence.length() > 0) {
|
||||
int newValue = Integer.parseInt(charSequence.toString());
|
||||
if (newValue > 0) {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putInt(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE + userId + instance, newValue);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
});
|
||||
split_size.setMax(5);
|
||||
split_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
|
|
|
@ -527,11 +527,12 @@
|
|||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/set_split_text"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:inputType="number"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<SeekBar
|
||||
|
|
|
@ -1735,10 +1735,31 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
|
|||
LinearLayout set_split_container = rootView.findViewById(R.id.set_split_container);
|
||||
//split size
|
||||
SeekBar split_size = rootView.findViewById(R.id.set_split_size);
|
||||
final TextView split_text = rootView.findViewById(R.id.set_split_text);
|
||||
final EditText split_text = rootView.findViewById(R.id.set_split_text);
|
||||
|
||||
split_size.setProgress(0);
|
||||
split_text.setText(String.valueOf(split_size_val));
|
||||
split_text.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (charSequence != null && charSequence.length() > 0) {
|
||||
int newValue = Integer.parseInt(charSequence.toString());
|
||||
if (newValue > 0) {
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putInt(Helper.SET_AUTOMATICALLY_SPLIT_TOOTS_SIZE + userId + instance, newValue);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
});
|
||||
split_size.setMax(5);
|
||||
split_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
|
|
|
@ -311,11 +311,12 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/set_split_text"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp" />
|
||||
android:layout_marginEnd="10dp"
|
||||
android:inputType="number" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/set_split_size"
|
||||
|
|
Loading…
Reference in New Issue