Browse Source

Fixing dialog padding for seekbar dialogs

master
anthony restaino 8 years ago
parent
commit
75bfe8ce64
  1. 2
      app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java
  2. 2
      app/src/main/java/acr/browser/lightning/fragment/DisplaySettingsFragment.java
  3. 9
      app/src/main/res/layout/dialog_seek_bar.xml

2
app/src/main/java/acr/browser/lightning/activity/ReadingActivity.java

@ -290,7 +290,7 @@ public class ReadingActivity extends AppCompatActivity {
break; break;
case R.id.text_size_item: case R.id.text_size_item:
View view = LayoutInflater.from(this).inflate(R.layout.seek_layout, null); View view = LayoutInflater.from(this).inflate(R.layout.dialog_seek_bar, null);
final SeekBar bar = (SeekBar) view.findViewById(R.id.text_size_seekbar); final SeekBar bar = (SeekBar) view.findViewById(R.id.text_size_seekbar);
bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

2
app/src/main/java/acr/browser/lightning/fragment/DisplaySettingsFragment.java

@ -151,7 +151,7 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme
private void textSizePicker() { private void textSizePicker() {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater(); LayoutInflater inflater = getActivity().getLayoutInflater();
LinearLayout view = (LinearLayout) inflater.inflate(R.layout.seek_layout, null); LinearLayout view = (LinearLayout) inflater.inflate(R.layout.dialog_seek_bar, null);
final SeekBar bar = (SeekBar) view.findViewById(R.id.text_size_seekbar); final SeekBar bar = (SeekBar) view.findViewById(R.id.text_size_seekbar);
final TextView sample = new TextView(getActivity()); final TextView sample = new TextView(getActivity());
sample.setText(R.string.untitled); sample.setText(R.string.untitled);

9
app/src/main/res/layout/seek_layout.xml → app/src/main/res/layout/dialog_seek_bar.xml

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > android:orientation="vertical"
android:padding="@dimen/dialog_padding">
<SeekBar <SeekBar
android:id="@+id/text_size_seekbar" android:id="@+id/text_size_seekbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"/>
android:layout_margin="10dp" />
</LinearLayout> </LinearLayout>
Loading…
Cancel
Save