140140import retrofit2 .Call ;
141141import retrofit2 .Response ;
142142
143+ import static com .zulip .android .util .Constants .REQUEST_PICK_FILE ;
144+
143145/**
144146 * The main Activity responsible for holding the {@link MessageListFragment} which has the list to the
145147 * messages
@@ -157,8 +159,6 @@ public class ZulipActivity extends BaseActivity implements
157159 private static final int PERMISSION_REQUEST_READ_STORAGE = 1 ;
158160 private static final int REQUEST_TAKE_PHOTO = 2 ;
159161 private static final Interpolator FAST_OUT_SLOW_IN_INTERPOLATOR = new FastOutSlowInInterpolator ();
160- private static final int HIDE_FAB_AFTER_SEC = 5 ;
161- private static final int REQUEST_PICK_FILE = 3 ;
162162 // row number which is used to differentiate the 'All private messages'
163163 // row from the people
164164 final int allPeopleId = -1 ;
@@ -570,9 +570,11 @@ public void showListDialog() {
570570 dialog .show (getFragmentManager (), "ListDialogFragment" );
571571 }
572572
573- // The dialog fragment receives a reference to this Activity through the
574- // Fragment.onAttach() callback, which it uses to call the following methods
575- // defined by the ListDialogFragment.ListDialogListener interface
573+ /**
574+ * The dialog fragment receives a reference to this Activity through the
575+ * Fragment.onAttach() callback, which it uses to call the following methods
576+ * defined by the ListDialogFragment.ListDialogListener interface.
577+ */
576578 @ Override
577579 public void onDialogPhotoClick (DialogFragment dialog ) {
578580 // User touched the dialog's "Take picture" button
@@ -946,6 +948,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
946948 if (data .getData () != null ) {
947949 fileUris .add (data .getData ());
948950 }
951+ // intent.getClipData was added in api 16
949952 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN ) {
950953 ClipData clipData = data .getClipData ();
951954 if (clipData != null ) {
@@ -1309,7 +1312,7 @@ private void setupFab() {
13091312 fab = (FloatingActionButton ) findViewById (R .id .fab );
13101313 chatBox = (SwipeRemoveLinearLayout ) findViewById (R .id .messageBoxContainer );
13111314 chatBox .registerToSwipeEvents (this );
1312- fabHidder = new CountDownTimer (HIDE_FAB_AFTER_SEC * 1000 , HIDE_FAB_AFTER_SEC * 1000 ) {
1315+ fabHidder = new CountDownTimer (Constants . HIDE_FAB_AFTER_SEC * 1000 , Constants . HIDE_FAB_AFTER_SEC * 1000 ) {
13131316 public void onTick (long millisUntilFinished ) {
13141317 }
13151318
@@ -2368,7 +2371,7 @@ private void dispatchPickIntent() {
23682371 }
23692372
23702373 if (intent .resolveActivity (getPackageManager ()) != null ) {
2371- startActivityForResult (intent , REQUEST_PICK_FILE );
2374+ startActivityForResult (intent , Constants . REQUEST_PICK_FILE );
23722375 // activity transition animation
23732376 ActivityTransitionAnim .transition (ZulipActivity .this );
23742377 }
0 commit comments