警告つぶしと翻訳追加
This commit is contained in:
parent
8ceeb787a5
commit
c67173f89a
@ -21,8 +21,8 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
shrinkResources true
|
shrinkResources false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
app/proguard-rules.pro
vendored
4
app/proguard-rules.pro
vendored
@ -35,6 +35,6 @@
|
|||||||
public *;
|
public *;
|
||||||
}
|
}
|
||||||
|
|
||||||
# for DexGuard only
|
## for DexGuard only
|
||||||
-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
|
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
|
||||||
|
|
||||||
|
@ -881,7 +881,7 @@
|
|||||||
<string name="highlight_desc">フリックで削除。登録内容を反映するにはカラムのリロードが必要です</string>
|
<string name="highlight_desc">フリックで削除。登録内容を反映するにはカラムのリロードが必要です</string>
|
||||||
<string name="check_sound">音を確認</string>
|
<string name="check_sound">音を確認</string>
|
||||||
<string name="keyword">キーワード</string>
|
<string name="keyword">キーワード</string>
|
||||||
<string name="domain_block_from_pseudo">Can\'t use domain block from pseudo account.</string>
|
<string name="domain_block_from_pseudo">疑似アカウントではドメインブロックできません</string>
|
||||||
<string name="domain_block_from_local">Can\'t use domain block for local instance.</string>
|
<string name="domain_block_from_local">自分のタンスにはドメインブロックできません</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.jrummyapps.android.colorpicker;
|
package com.jrummyapps.android.colorpicker;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
@ -50,6 +51,9 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.jrummyapps.android.colorpicker.ColorPickerView.OnColorChangedListener;
|
import com.jrummyapps.android.colorpicker.ColorPickerView.OnColorChangedListener;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@ -251,11 +255,11 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
|
|
||||||
View createPickerView() {
|
View createPickerView() {
|
||||||
View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_color_picker, null);
|
View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_color_picker, null);
|
||||||
colorPicker = (ColorPickerView) contentView.findViewById(R.id.cpv_color_picker_view);
|
colorPicker = contentView.findViewById(R.id.cpv_color_picker_view);
|
||||||
ColorPanelView oldColorPanel = (ColorPanelView) contentView.findViewById(R.id.cpv_color_panel_old);
|
ColorPanelView oldColorPanel = contentView.findViewById(R.id.cpv_color_panel_old);
|
||||||
newColorPanel = (ColorPanelView) contentView.findViewById(R.id.cpv_color_panel_new);
|
newColorPanel = contentView.findViewById(R.id.cpv_color_panel_new);
|
||||||
ImageView arrowRight = (ImageView) contentView.findViewById(R.id.cpv_arrow_right);
|
ImageView arrowRight = contentView.findViewById(R.id.cpv_arrow_right);
|
||||||
hexEditText = (EditText) contentView.findViewById(R.id.cpv_hex);
|
hexEditText = contentView.findViewById(R.id.cpv_hex);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final TypedValue value = new TypedValue();
|
final TypedValue value = new TypedValue();
|
||||||
@ -295,7 +299,7 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
public void onFocusChange(View v, boolean hasFocus) {
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.showSoftInput(hexEditText, InputMethodManager.SHOW_IMPLICIT);
|
if(imm!=null ) imm.showSoftInput(hexEditText, InputMethodManager.SHOW_IMPLICIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -303,11 +307,12 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
return contentView;
|
return contentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean onTouch(View v, MotionEvent event) {
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
|
@Override public boolean onTouch( View v, MotionEvent event) {
|
||||||
if (v != hexEditText && hexEditText.hasFocus()) {
|
if (v != hexEditText && hexEditText.hasFocus()) {
|
||||||
hexEditText.clearFocus();
|
hexEditText.clearFocus();
|
||||||
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.hideSoftInputFromWindow(hexEditText.getWindowToken(), 0);
|
if(imm!=null ) imm.hideSoftInputFromWindow(hexEditText.getWindowToken(), 0);
|
||||||
hexEditText.clearFocus();
|
hexEditText.clearFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -321,7 +326,7 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
setHex(newColor);
|
setHex(newColor);
|
||||||
if (hexEditText.hasFocus()) {
|
if (hexEditText.hasFocus()) {
|
||||||
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.hideSoftInputFromWindow(hexEditText.getWindowToken(), 0);
|
if(imm!=null ) imm.hideSoftInputFromWindow(hexEditText.getWindowToken(), 0);
|
||||||
hexEditText.clearFocus();
|
hexEditText.clearFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,10 +419,10 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
|
|
||||||
View createPresetsView() {
|
View createPresetsView() {
|
||||||
View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_presets, null);
|
View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_presets, null);
|
||||||
shadesLayout = (LinearLayout) contentView.findViewById(R.id.shades_layout);
|
shadesLayout = contentView.findViewById(R.id.shades_layout);
|
||||||
transparencySeekBar = (SeekBar) contentView.findViewById(R.id.transparency_seekbar);
|
transparencySeekBar = contentView.findViewById(R.id.transparency_seekbar);
|
||||||
transparencyPercText = (TextView) contentView.findViewById(R.id.transparency_text);
|
transparencyPercText = contentView.findViewById(R.id.transparency_text);
|
||||||
GridView gridView = (GridView) contentView.findViewById(R.id.gridView);
|
GridView gridView = contentView.findViewById(R.id.gridView);
|
||||||
|
|
||||||
loadPresets();
|
loadPresets();
|
||||||
|
|
||||||
@ -483,8 +488,8 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
if (shadesLayout.getChildCount() != 0) {
|
if (shadesLayout.getChildCount() != 0) {
|
||||||
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
||||||
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
||||||
final ColorPanelView cpv = (ColorPanelView) layout.findViewById(R.id.cpv_color_panel_view);
|
final ColorPanelView cpv = layout.findViewById(R.id.cpv_color_panel_view);
|
||||||
ImageView iv = (ImageView) layout.findViewById(R.id.cpv_color_image_view);
|
ImageView iv = layout.findViewById(R.id.cpv_color_image_view);
|
||||||
cpv.setColor(colorShades[i]);
|
cpv.setColor(colorShades[i]);
|
||||||
cpv.setTag(false);
|
cpv.setTag(false);
|
||||||
iv.setImageDrawable(null);
|
iv.setImageDrawable(null);
|
||||||
@ -503,7 +508,7 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
final View view = View.inflate(getActivity(), layoutResId, null);
|
final View view = View.inflate(getActivity(), layoutResId, null);
|
||||||
final ColorPanelView colorPanelView = (ColorPanelView) view.findViewById(R.id.cpv_color_panel_view);
|
final ColorPanelView colorPanelView = view.findViewById(R.id.cpv_color_panel_view);
|
||||||
|
|
||||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) colorPanelView.getLayoutParams();
|
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) colorPanelView.getLayoutParams();
|
||||||
params.leftMargin = params.rightMargin = horizontalPadding;
|
params.leftMargin = params.rightMargin = horizontalPadding;
|
||||||
@ -529,8 +534,8 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
adapter.selectNone();
|
adapter.selectNone();
|
||||||
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
||||||
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
||||||
ColorPanelView cpv = (ColorPanelView) layout.findViewById(R.id.cpv_color_panel_view);
|
ColorPanelView cpv = layout.findViewById(R.id.cpv_color_panel_view);
|
||||||
ImageView iv = (ImageView) layout.findViewById(R.id.cpv_color_image_view);
|
ImageView iv = layout.findViewById(R.id.cpv_color_image_view);
|
||||||
iv.setImageResource(cpv == v ? R.drawable.cpv_preset_checked : 0);
|
iv.setImageResource(cpv == v ? R.drawable.cpv_preset_checked : 0);
|
||||||
if (cpv == v && ColorUtils.calculateLuminance(cpv.getColor()) >= 0.65 ||
|
if (cpv == v && ColorUtils.calculateLuminance(cpv.getColor()) >= 0.65 ||
|
||||||
Color.alpha(cpv.getColor()) <= ALPHA_THRESHOLD) {
|
Color.alpha(cpv.getColor()) <= ALPHA_THRESHOLD) {
|
||||||
@ -606,8 +611,8 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
// update shades:
|
// update shades:
|
||||||
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
for (int i = 0; i < shadesLayout.getChildCount(); i++) {
|
||||||
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
FrameLayout layout = (FrameLayout) shadesLayout.getChildAt(i);
|
||||||
ColorPanelView cpv = (ColorPanelView) layout.findViewById(R.id.cpv_color_panel_view);
|
ColorPanelView cpv = layout.findViewById(R.id.cpv_color_panel_view);
|
||||||
ImageView iv = (ImageView) layout.findViewById(R.id.cpv_color_image_view);
|
ImageView iv = layout.findViewById(R.id.cpv_color_image_view);
|
||||||
if (layout.getTag() == null) {
|
if (layout.getTag() == null) {
|
||||||
// save the original border color
|
// save the original border color
|
||||||
layout.setTag(cpv.getBorderColor());
|
layout.setTag(cpv.getBorderColor());
|
||||||
@ -697,7 +702,7 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
|
|
||||||
// region Builder
|
// region Builder
|
||||||
|
|
||||||
public static final class Builder {
|
@SuppressWarnings("WeakerAccess") public static final class Builder {
|
||||||
|
|
||||||
@StringRes int dialogTitle = R.string.cpv_default_title;
|
@StringRes int dialogTitle = R.string.cpv_default_title;
|
||||||
@DialogType int dialogType = TYPE_PRESETS;
|
@DialogType int dialogType = TYPE_PRESETS;
|
||||||
@ -869,6 +874,7 @@ public class ColorPickerDialog extends DialogFragment implements OnTouchListener
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({TYPE_CUSTOM, TYPE_PRESETS})
|
@IntDef({TYPE_CUSTOM, TYPE_PRESETS})
|
||||||
public @interface DialogType {
|
public @interface DialogType {
|
||||||
|
|
||||||
|
@ -18,9 +18,13 @@ package com.jrummyapps.android.colorpicker;
|
|||||||
|
|
||||||
import android.support.annotation.IntDef;
|
import android.support.annotation.IntDef;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The shape of the color preview
|
* The shape of the color preview
|
||||||
*/
|
*/
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({ColorShape.SQUARE, ColorShape.CIRCLE})
|
@IntDef({ColorShape.SQUARE, ColorShape.CIRCLE})
|
||||||
public @interface ColorShape {
|
public @interface ColorShape {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user