Skip to content

Commit

Permalink
NonNull annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
davemorrissey committed Dec 15, 2017
1 parent ab56d7c commit 9a3dc7d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.extension;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -14,7 +15,7 @@
public class ExtensionCircleFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.extension_circle_fragment, container, false);
rootView.findViewById(id.next).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { ((ExtensionActivity) ExtensionCircleFragment.this.getActivity()).next(); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.extension;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -14,7 +15,7 @@
public class ExtensionFreehandFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.extension_freehand_fragment, container, false);
rootView.findViewById(id.previous).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { ((ExtensionActivity) ExtensionFreehandFragment.this.getActivity()).previous(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.PointF;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -15,7 +16,7 @@
public class ExtensionPinFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.extension_pin_fragment, container, false);
rootView.findViewById(id.next).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { ((ExtensionActivity) ExtensionPinFragment.this.getActivity()).next(); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.imagedisplay;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -14,7 +15,7 @@
public class ImageDisplayLargeFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.imagedisplay_large_fragment, container, false);
rootView.findViewById(id.next).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) { ((ImageDisplayActivity) ImageDisplayLargeFragment.this.getActivity()).next(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -21,7 +22,7 @@
public class ImageDisplayRegionFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.imagedisplay_region_fragment, container, false);
final SubsamplingScaleImageView imageView = rootView.findViewById(id.imageView);
imageView.setBitmapDecoderFactory(new CompatDecoderFactory<ImageDecoder>(SkiaImageDecoder.class, Bitmap.Config.ARGB_8888));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.imagedisplay;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -14,7 +15,7 @@
public class ImageDisplayRotateFragment extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.imagedisplay_rotate_fragment, container, false);
final SubsamplingScaleImageView imageView = rootView.findViewById(id.imageView);
imageView.setImage(ImageSource.asset("swissroad.jpg"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.viewpager;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
Expand Down Expand Up @@ -29,7 +30,7 @@ private void init() {
private class VerticalPageTransformer implements ViewPager.PageTransformer {

@Override
public void transformPage(View view, float position) {
public void transformPage(@NonNull View view, float position) {
if (position < -1) {
view.setAlpha(0);
} else if (position <= 1) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.davemorrissey.labs.subscaleview.test.viewpager;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -25,7 +26,7 @@ public void setAsset(String asset) {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.view_pager_page, container, false);

if (savedInstanceState != null) {
Expand All @@ -42,7 +43,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
}

@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
View rootView = getView();
if (rootView != null) {
Expand Down

0 comments on commit 9a3dc7d

Please sign in to comment.