Small layout improvements

pull/156/head
M66B 6 years ago
parent 1f5f705c68
commit cf63531253

@ -45,11 +45,11 @@ import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
public class FragmentOptionsConnection extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener { public class FragmentOptionsConnection extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private TextView tvConnectionType;
private TextView tvConnectionRoaming;
private SwitchCompat swMetered; private SwitchCompat swMetered;
private Spinner spDownload; private Spinner spDownload;
private SwitchCompat swRoaming; private SwitchCompat swRoaming;
private TextView tvConnectionType;
private TextView tvConnectionRoaming;
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"metered", "download", "roaming" "metered", "download", "roaming"
@ -65,12 +65,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
// Get controls // Get controls
tvConnectionType = view.findViewById(R.id.tvConnectionType);
tvConnectionRoaming = view.findViewById(R.id.tvConnectionRoaming);
swMetered = view.findViewById(R.id.swMetered); swMetered = view.findViewById(R.id.swMetered);
spDownload = view.findViewById(R.id.spDownload); spDownload = view.findViewById(R.id.spDownload);
swRoaming = view.findViewById(R.id.swRoaming); swRoaming = view.findViewById(R.id.swRoaming);
tvConnectionType = view.findViewById(R.id.tvConnectionType);
tvConnectionRoaming = view.findViewById(R.id.tvConnectionRoaming);
setOptions(); setOptions();
// Wire controls // Wire controls
@ -108,6 +109,9 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
tvConnectionType.setVisibility(View.GONE);
tvConnectionRoaming.setVisibility(View.GONE);
return view; return view;
} }

@ -18,38 +18,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="12dp"> android:padding="12dp">
<TextView
android:id="@+id/tvConnectionType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="Connection is unmetered"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvConnectionRoaming"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_legend_roaming"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvConnectionType" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swMetered" android:id="@+id/swMetered"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_metered" android:text="@string/title_advanced_metered"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvConnectionRoaming" app:layout_constraintTop_toBottomOf="@id/tvConnectionRoaming"
app:layout_constraintTop_toTopOf="parent"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<TextView <TextView
@ -94,7 +70,7 @@
android:id="@+id/spDownload" android:id="@+id/spDownload"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="12dp"
android:entries="@array/downloadNames" android:entries="@array/downloadNames"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDownload" /> app:layout_constraintTop_toBottomOf="@id/tvDownload" />
@ -108,6 +84,32 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spDownload" app:layout_constraintTop_toBottomOf="@id/spDownload"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<TextView
android:id="@+id/tvConnectionType"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="48dp"
android:text="Connection is unmetered"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/swRoaming" />
<TextView
android:id="@+id/tvConnectionRoaming"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginEnd="48dp"
android:text="@string/title_legend_roaming"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvConnectionType" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -33,7 +33,7 @@
android:id="@+id/spStartup" android:id="@+id/spStartup"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="12dp"
android:entries="@array/startupNames" android:entries="@array/startupNames"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvStartup" /> app:layout_constraintTop_toBottomOf="@id/tvStartup" />

@ -185,10 +185,11 @@
android:id="@+id/tvLastCleanup" android:id="@+id/tvLastCleanup"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="24dp"
android:layout_marginEnd="48dp" android:layout_marginEnd="48dp"
android:text="@string/title_advanced_last_cleanup" android:text="@string/title_advanced_last_cleanup"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebugHint" /> app:layout_constraintTop_toBottomOf="@id/tvDebugHint" />

@ -57,7 +57,7 @@
android:id="@+id/spPollInterval" android:id="@+id/spPollInterval"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="12dp"
android:entries="@array/pollIntervalNames" android:entries="@array/pollIntervalNames"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvWhen" /> app:layout_constraintTop_toBottomOf="@id/tvWhen" />
@ -76,7 +76,6 @@
android:id="@+id/tvScheduleStart" android:id="@+id/tvScheduleStart"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:padding="12dp" android:padding="12dp"
android:text="00:00" android:text="00:00"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"

Loading…
Cancel
Save