Make SeekBar away from edges and away from value view

This commit is contained in:
sponge
2012-07-29 21:36:16 +00:00
parent f34ef46dbf
commit c9abfa80f0
3 changed files with 14 additions and 7 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.i2p.android.router" package="net.i2p.android.router"
android.versionCode="4719083" android.versionCode="4719076"
android.versionName="0.9.0-30_b28-API8" android.versionName="0.9.0-30_b37-API8"
android:installLocation="preferExternal" android:installLocation="preferExternal"
> >
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.i2p.android.router" package="net.i2p.android.router"
android.versionCode="4719083" android.versionCode="4719076"
android.versionName="0.9.0-30_b28-API8" android.versionName="0.9.0-30_b37-API8"
android:installLocation="preferExternal" android:installLocation="preferExternal"
> >

View File

@ -63,11 +63,15 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
LinearLayout.LayoutParams params; LinearLayout.LayoutParams params;
LinearLayout layout = new LinearLayout(mContext); LinearLayout layout = new LinearLayout(mContext);
layout.setOrientation(LinearLayout.VERTICAL); layout.setOrientation(LinearLayout.VERTICAL);
layout.setPadding(6, 6, 6, 6); layout.setPadding(6, 6, 6, 10);
// Set the width so that it is as usable as possible.
// We multiplymMax so that the smaller ranges will get a bigger area.
if (mDirection == LinearLayout.HORIZONTAL) { if (mDirection == LinearLayout.HORIZONTAL) {
layout.setMinimumWidth(mMax); layout.setMinimumWidth(mMax*5);
} else { } else {
layout.setMinimumHeight(mMax); layout.setMinimumHeight(mMax*5);
} }
mSplashText = new TextView(mContext); mSplashText = new TextView(mContext);
@ -86,6 +90,9 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
mSeekBar = new SeekBar(mContext); mSeekBar = new SeekBar(mContext);
mSeekBar.setOnSeekBarChangeListener(this); mSeekBar.setOnSeekBarChangeListener(this);
// Move the bar away from the changing text, so you can see it, and
// move it away from the edges to improve usability for the end-ranges.
mSeekBar.setPadding(6, 30, 6, 6);
layout.addView(mSeekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); layout.addView(mSeekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
if (shouldPersist()) { if (shouldPersist()) {