fix alpha value parser
This commit is contained in:
parent
ee245f7574
commit
b8286aaf9e
@ -20,6 +20,7 @@ import android.widget.TextView;
|
||||
import com.jrummyapps.android.colorpicker.ColorPickerDialog;
|
||||
import com.jrummyapps.android.colorpicker.ColorPickerDialogListener;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import jp.juggler.subwaytooter.util.LogCategory;
|
||||
@ -243,7 +244,9 @@ public class ActColumnCustomize extends AppCompatActivity
|
||||
@Override public void afterTextChanged( Editable s ){
|
||||
if( loading_busy ) return;
|
||||
try{
|
||||
float f = Float.parseFloat( etAlpha.getText().toString() );
|
||||
NumberFormat format = NumberFormat.getInstance( Locale.getDefault() );
|
||||
Number number = format.parse( etAlpha.getText().toString() );
|
||||
float f = number.floatValue();
|
||||
if( ! Float.isNaN( f ) ){
|
||||
if( f < 0f ) f = 0f;
|
||||
if( f > 1f ) f = 1f;
|
||||
|
@ -379,6 +379,12 @@ class ColumnViewHolder
|
||||
|
||||
private void loadBackgroundImage( final ImageView iv, final String url ){
|
||||
try{
|
||||
if( TextUtils.isEmpty( url ) ){
|
||||
// 指定がないなら閉じる
|
||||
closeBitmaps();
|
||||
return;
|
||||
}
|
||||
|
||||
if( url.equals( last_image_uri ) ){
|
||||
// 今表示してるのと同じ
|
||||
return;
|
||||
|
@ -2,16 +2,15 @@
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/svContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:id="@+id/svContent"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="128dp"
|
||||
android:clipToPadding="false"
|
||||
|
||||
android:fillViewport="true"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
@ -34,12 +33,12 @@
|
||||
android:id="@+id/llColumnHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingTop="3dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
@ -205,20 +204,35 @@
|
||||
|
||||
<TextView
|
||||
style="@style/setting_row_label"
|
||||
android:labelFor="@+id/etAlpha"
|
||||
android:text="@string/image_alpha"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/setting_row_form">
|
||||
<LinearLayout
|
||||
style="@style/setting_row_form"
|
||||
android:layout_height="48dp"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etAlpha"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:digits="0123456789.,"
|
||||
android:inputType="numberDecimal"
|
||||
android:id="@+id/etAlpha"
|
||||
android:maxLines="1"
|
||||
android:minLines="1"
|
||||
android:minWidth="64dp"
|
||||
/>
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/sbColumnBackgroundAlpha"
|
||||
style="@style/setting_horizontal_stretch"
|
||||
|
Loading…
x
Reference in New Issue
Block a user