Upgrade support libraries to 23.2.1
This commit is contained in:
@ -56,7 +56,7 @@ dependencies {
|
||||
compile project(':lib:client')
|
||||
|
||||
// Android Support Repository dependencies
|
||||
def supportVersion = '23.1.1'
|
||||
def supportVersion = '23.2.1'
|
||||
compile "com.android.support:support-v4:$supportVersion"
|
||||
compile "com.android.support:appcompat-v7:$supportVersion"
|
||||
compile "com.android.support:preference-v7:$supportVersion"
|
||||
@ -71,7 +71,6 @@ dependencies {
|
||||
}
|
||||
compile 'com.pnikosis:materialish-progress:1.7'
|
||||
compile 'net.i2p.android.ext:floatingactionbutton:1.10.1'
|
||||
compile 'org.adw.library:discrete-seekbar:1.0.1'
|
||||
compile 'org.sufficientlysecure:html-textview:1.3'
|
||||
|
||||
// Testing-only dependencies
|
||||
@ -81,18 +80,17 @@ dependencies {
|
||||
|
||||
dependencyVerification {
|
||||
verify = [
|
||||
'com.android.support:support-v4:5c7dceb6c824089fe80f502e5206264048ef8bffa4e8ddeab180b81723e79b7f',
|
||||
'com.android.support:appcompat-v7:0a8762214382b7e8d4b989b4ac10b5c846b957d767ccb7bccbc6be5afa885a82',
|
||||
'com.android.support:preference-v7:4b6dabaa4400cbed885c7edc885aa6372468f48d628cc0d4a04b9ccd128ed324',
|
||||
'com.android.support:preference-v14:a69906c2b29b315ac3c1fdf01537a7557660a65b8ea1cf891baa8665e1197459',
|
||||
'com.android.support:recyclerview-v7:7606373da0931a1e62588335465a0e390cd676c98117edab29220317495faefd',
|
||||
'com.android.support:support-v4:81ce890f26d35c75ad17d0f998a7e3230330c3b41e0b629566bc744bee89e448',
|
||||
'com.android.support:appcompat-v7:00f9d93acacd6731f309724054bf51492814b4b2869f16d7d5c0038dcb8c9a0d',
|
||||
'com.android.support:preference-v7:775101bd07bd052e455761c5c5d9523d7ad59f2f320e3e8cbde241fd6b1d6025',
|
||||
'com.android.support:preference-v14:44881bb46094e86d0bc2426f205419674a5b4eb514b44b5a4659b5de29f71eb7',
|
||||
'com.android.support:recyclerview-v7:44040a888e23e0c93162a3377cfe06751080e3c22d369ab0d4301ef60d63b0fe',
|
||||
'com.androidplot:androidplot-core:1aaa931974da9d351976ed3d4b67170ac2a78be6c6afd13559ded5534eefc264',
|
||||
'com.eowise:recyclerview-stickyheaders:7b236da49b33b840e9ba6e7e4182218d1a2d9047236fdbc3ca947352f9b0883b',
|
||||
'com.mcxiaoke.viewpagerindicator:library:1e8aad664137f68abdfee94889f6da3dc98be652a235176a403965a07a25de62',
|
||||
'com.pnikosis:materialish-progress:da089a90d1dab61e9b50038c09081019398f81190d12b0b567ce94b83ef8cf93',
|
||||
'net.i2p.android.ext:floatingactionbutton:09d43e2d4ac04a91bf7a37e1ec48a8d220204e3a55dca72cd36cd9fa27461ade',
|
||||
'org.sufficientlysecure:html-textview:39048e35894e582adada388e6c00631803283f8defed8e07ad58a5f284f272ee',
|
||||
'org.adw.library:discrete-seekbar:5d12196065939d5cf709969da416d1275ad020cddace186488e5bed030663432',
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -8,37 +8,31 @@ import android.support.v7.preference.Preference;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.i2p.android.router.R;
|
||||
|
||||
import org.adw.library.widgets.discreteseekbar.DiscreteSeekBar;
|
||||
|
||||
/**
|
||||
* Based on MaterialSeekBarController created by mrbimc on 30.09.15.
|
||||
*/
|
||||
public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChangeListener {
|
||||
public class MaterialSeekBarController implements SeekBar.OnSeekBarChangeListener {
|
||||
|
||||
private final String TAG = getClass().getName();
|
||||
|
||||
public static final int DEFAULT_CURRENT_VALUE = 50;
|
||||
private static final int DEFAULT_MIN_VALUE = 0;
|
||||
private static final int DEFAULT_MAX_VALUE = 100;
|
||||
private static final String DEFAULT_MEASUREMENT_UNIT = "";
|
||||
|
||||
private int mMaxValue;
|
||||
private int mMaxDigits;
|
||||
private int mMinValue;
|
||||
private int mCurrentValue;
|
||||
private String mMeasurementUnit;
|
||||
|
||||
private DiscreteSeekBar mSeekBar;
|
||||
private SeekBar mSeekBar;
|
||||
private TextView mSeekBarValue;
|
||||
private TextView mMeasurementUnitView;
|
||||
|
||||
private String mTitle;
|
||||
private String mSummary;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private Persistable mPersistable;
|
||||
@ -49,12 +43,6 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
init(attrs, null);
|
||||
}
|
||||
|
||||
public MaterialSeekBarController(Context context, AttributeSet attrs, View view, Persistable persistable) {
|
||||
mContext = context;
|
||||
mPersistable = persistable;
|
||||
init(attrs, view);
|
||||
}
|
||||
|
||||
private void init(AttributeSet attrs, View view) {
|
||||
setValuesFromXml(attrs);
|
||||
if(view != null) onBindView(view);
|
||||
@ -62,20 +50,15 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
private void setValuesFromXml(@Nullable AttributeSet attrs) {
|
||||
if (attrs == null) {
|
||||
mCurrentValue = DEFAULT_CURRENT_VALUE;
|
||||
mMinValue = DEFAULT_MIN_VALUE;
|
||||
mMaxValue = DEFAULT_MAX_VALUE;
|
||||
mMeasurementUnit = DEFAULT_MEASUREMENT_UNIT;
|
||||
} else {
|
||||
TypedArray a = mContext.obtainStyledAttributes(attrs, R.styleable.SeekBarPreference);
|
||||
try {
|
||||
mMinValue = a.getInt(R.styleable.SeekBarPreference_msbp_minValue, DEFAULT_MIN_VALUE);
|
||||
mMaxValue = a.getInt(R.styleable.SeekBarPreference_msbp_maxValue, DEFAULT_MAX_VALUE);
|
||||
mCurrentValue = a.getInt(R.styleable.SeekBarPreference_msbp_defaultValue, DEFAULT_CURRENT_VALUE);
|
||||
|
||||
mTitle = a.getString(R.styleable.SeekBarPreference_msbp_title);
|
||||
mSummary = a.getString(R.styleable.SeekBarPreference_msbp_summary);
|
||||
|
||||
if(mCurrentValue < mMinValue) mCurrentValue = (mMaxValue - mMinValue) / 2;
|
||||
if(mCurrentValue > mMaxValue) mCurrentValue = mMaxValue / 2;
|
||||
mMeasurementUnit = a.getString(R.styleable.SeekBarPreference_msbp_measurementUnit);
|
||||
if (mMeasurementUnit == null)
|
||||
mMeasurementUnit = DEFAULT_MEASUREMENT_UNIT;
|
||||
@ -86,16 +69,11 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
mMaxDigits = (int) Math.log10(mMaxValue) + 1;
|
||||
}
|
||||
|
||||
public void setOnPersistListener(Persistable persistable) {
|
||||
mPersistable = persistable;
|
||||
}
|
||||
|
||||
public void onBindView(@NonNull View view) {
|
||||
|
||||
mSeekBar = (DiscreteSeekBar) view.findViewById(R.id.seekbar);
|
||||
mSeekBar.setMin(mMinValue);
|
||||
mSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
|
||||
mSeekBar.setMax(mMaxValue);
|
||||
mSeekBar.setOnProgressChangeListener(this);
|
||||
mSeekBar.setOnSeekBarChangeListener(this);
|
||||
|
||||
mSeekBarValue = (TextView) view.findViewById(R.id.seekbar_value);
|
||||
setPaddedValue(mCurrentValue);
|
||||
@ -109,18 +87,10 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
mSeekBar.setEnabled(false);
|
||||
mSeekBarValue.setEnabled(false);
|
||||
}
|
||||
|
||||
if(mTitle != null || mSummary != null) {
|
||||
TextView title = (TextView) view.findViewById(android.R.id.title);
|
||||
TextView summary = (TextView) view.findViewById(android.R.id.summary);
|
||||
|
||||
if(mTitle != null) title.setText(mTitle);
|
||||
if(mSummary != null) summary.setText(mSummary);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onSetInitialValue(boolean restoreValue, @NonNull Object defaultValue) {
|
||||
mCurrentValue = (mMaxValue - mMinValue) / 2;
|
||||
mCurrentValue = mMaxValue / 2;
|
||||
try {
|
||||
mCurrentValue = (Integer) defaultValue;
|
||||
} catch (Exception ex) {
|
||||
@ -140,17 +110,17 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
|
||||
//SeekBarListener:
|
||||
@Override
|
||||
public void onProgressChanged(@NonNull DiscreteSeekBar seekBar, int progress, boolean fromUser) {
|
||||
public void onProgressChanged(@NonNull SeekBar seekBar, int progress, boolean fromUser) {
|
||||
mCurrentValue = progress;
|
||||
setPaddedValue(progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(DiscreteSeekBar seekBar) {
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(@NonNull DiscreteSeekBar seekBar) {
|
||||
public void onStopTrackingTouch(@NonNull SeekBar seekBar) {
|
||||
setCurrentValue(mCurrentValue);
|
||||
}
|
||||
|
||||
@ -180,16 +150,6 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
}
|
||||
|
||||
|
||||
public void setMinValue(int minValue) {
|
||||
mMinValue = minValue;
|
||||
if (mSeekBar != null) mSeekBar.setMin(mMinValue);
|
||||
}
|
||||
|
||||
public int getMinValue() {
|
||||
return mMinValue;
|
||||
}
|
||||
|
||||
|
||||
public void setMeasurementUnit(String measurementUnit) {
|
||||
mMeasurementUnit = measurementUnit;
|
||||
if (mMeasurementUnitView != null) mMeasurementUnitView.setText(mMeasurementUnit);
|
||||
@ -198,8 +158,4 @@ public class MaterialSeekBarController implements DiscreteSeekBar.OnProgressChan
|
||||
public String getMeasurementUnit() {
|
||||
return mMeasurementUnit;
|
||||
}
|
||||
|
||||
static int pxFromDp(int dp, Context context) {
|
||||
return (int) (dp * context.getResources().getDisplayMetrics().density);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class SeekBarPreference extends Preference implements Persistable {
|
||||
|
||||
@Override
|
||||
protected void onSetInitialValue(boolean restoreValue, @NonNull Object defaultValue) {
|
||||
int average = (mController.getMaxValue() - mController.getMinValue()) / 2;
|
||||
int average = mController.getMaxValue() / 2;
|
||||
if(restoreValue) mController.setCurrentValue(getPersistedInt(average));
|
||||
else mController.onSetInitialValue(restoreValue, defaultValue);
|
||||
}
|
||||
@ -86,14 +86,6 @@ public class SeekBarPreference extends Preference implements Persistable {
|
||||
mController.setMeasurementUnit(measurementUnit);
|
||||
}
|
||||
|
||||
public int getMinValue() {
|
||||
return mController.getMinValue();
|
||||
}
|
||||
|
||||
public void setMinValue(int minValue) {
|
||||
mController.setMinValue(minValue);
|
||||
}
|
||||
|
||||
public int getMaxValue() {
|
||||
return mController.getMaxValue();
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<org.adw.library.widgets.discreteseekbar.DiscreteSeekBar
|
||||
<SeekBar
|
||||
android:id="@+id/seekbar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/value_holder"
|
||||
|
@ -10,12 +10,8 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="SeekBarPreference">
|
||||
<attr name="msbp_minValue" format="reference|integer"/>
|
||||
<attr name="msbp_maxValue" format="reference|integer"/>
|
||||
<attr name="msbp_defaultValue" format="reference|integer"/>
|
||||
<attr name="msbp_measurementUnit" format="reference|string"/>
|
||||
|
||||
<attr name="msbp_title" format="reference|string"/>
|
||||
<attr name="msbp_summary" format="reference|string"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
@ -12,10 +12,6 @@
|
||||
<color name="menu_label_background">#b2000000</color>
|
||||
<color name="menu_label_text">#fafafa</color>
|
||||
|
||||
<color name="dsb_progress_color">@color/accent</color>
|
||||
<color name="dsb_track_color">#48ffffff</color> <!-- 30% White -->
|
||||
<color name="dsb_disabled_color">#48ffffff</color> <!-- 30% White -->
|
||||
|
||||
<color name="pager_indicator_footer_color">@color/primary</color>
|
||||
<color name="pager_indicator_selected_color">@color/primary_text_default_material_dark</color>
|
||||
<color name="pager_indicator_text_color">@color/primary_text_disabled_material_dark</color>
|
||||
|
Reference in New Issue
Block a user