Effectively final.

This commit is contained in:
akwizgran
2017-11-17 15:40:54 +00:00
committed by Torsten Grote
parent a5b321a93b
commit d7383a3361
153 changed files with 1337 additions and 1396 deletions

View File

@@ -65,7 +65,7 @@ public class KeyboardAwareLinearLayout extends LinearLayout {
@Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
rotation = getDeviceRotation();
final int statusBarRes = getResources()
int statusBarRes = getResources()
.getIdentifier("status_bar_height", "dimen", "android");
minKeyboardSize =
getResources().getDimensionPixelSize(R.dimen.min_keyboard_size);
@@ -199,7 +199,7 @@ public class KeyboardAwareLinearLayout extends LinearLayout {
prefs.edit().putInt("keyboard_height_portrait", height).apply();
}
public void postOnKeyboardClose(final Runnable runnable) {
public void postOnKeyboardClose(Runnable runnable) {
if (keyboardOpen) {
addOnKeyboardHiddenListener(new OnKeyboardHiddenListener() {
@Override
@@ -213,7 +213,7 @@ public class KeyboardAwareLinearLayout extends LinearLayout {
}
}
public void postOnKeyboardOpen(final Runnable runnable) {
public void postOnKeyboardOpen(Runnable runnable) {
if (!keyboardOpen) {
addOnKeyboardShownListener(new OnKeyboardShownListener() {
@Override

View File

@@ -56,7 +56,7 @@ public class EmojiDrawer extends LinearLayout {
}
private void initView() {
final View v = LayoutInflater.from(getContext())
View v = LayoutInflater.from(getContext())
.inflate(R.layout.emoji_drawer, this, true);
initializeResources(v);
initializePageModels();

View File

@@ -33,8 +33,8 @@ public class EmojiEditText extends AppCompatEditText {
}
public void insertEmoji(String emoji) {
final int start = getSelectionStart();
final int end = getSelectionEnd();
int start = getSelectionStart();
int end = getSelectionEnd();
getText().replace(Math.min(start, end), Math.max(start, end), emoji);
setSelection(start + emoji.length());

View File

@@ -33,7 +33,7 @@ public class EmojiPageView extends FrameLayout {
public EmojiPageView(Context context, @Nullable AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
final View view = LayoutInflater.from(getContext())
View view = LayoutInflater.from(getContext())
.inflate(R.layout.emoji_grid_layout, this, true);
grid = (GridView) view.findViewById(R.id.emoji);
grid.setColumnWidth(getResources()

View File

@@ -135,10 +135,10 @@ public class EmojiProvider {
return null;
}
final EmojiDrawable drawable = new EmojiDrawable(drawInfo, decodeScale);
EmojiDrawable drawable = new EmojiDrawable(drawInfo, decodeScale);
drawInfo.page.get().addListener(new FutureTaskListener<Bitmap>() {
@Override
public void onSuccess(final Bitmap result) {
public void onSuccess(Bitmap result) {
androidExecutor.runOnUiThread(() -> drawable.setBitmap(result));
}

View File

@@ -109,7 +109,7 @@ public class RecentEmojiPageModel implements EmojiPageModel {
return result;
}
private void save(final String serialized) {
private void save(String serialized) {
dbExecutor.execute(() -> {
Settings settings = new Settings();
settings.put(EMOJI_LRU_PREFERENCE, serialized);

View File

@@ -41,11 +41,11 @@ public class ListenableFutureTask<V> extends FutureTask<V> {
this.identifier = identifier;
}
public ListenableFutureTask(final V result) {
public ListenableFutureTask(V result) {
this(result, null);
}
private ListenableFutureTask(final V result, @Nullable Object identifier) {
private ListenableFutureTask(V result, @Nullable Object identifier) {
super(() -> result);
this.identifier = identifier;
this.run();

View File

@@ -40,14 +40,14 @@ public class BitmapUtil {
private static <T> Bitmap createScaledBitmapInto(Context context, T model,
int width, int height)
throws BitmapDecodingException {
final Bitmap rough = Downsampler.AT_LEAST
Bitmap rough = Downsampler.AT_LEAST
.decode(getInputStreamForModel(context, model),
Glide.get(context).getBitmapPool(),
width, height, DecodeFormat.PREFER_RGB_565);
final Resource<Bitmap> resource = BitmapResource
Resource<Bitmap> resource = BitmapResource
.obtain(rough, Glide.get(context).getBitmapPool());
final Resource<Bitmap> result =
Resource<Bitmap> result =
new FitCenter(context).transform(resource, width, height);
if (result == null) {