140
140
import retrofit2 .Call ;
141
141
import retrofit2 .Response ;
142
142
143
+ import static com .zulip .android .util .Constants .REQUEST_PICK_FILE ;
144
+
143
145
/**
144
146
* The main Activity responsible for holding the {@link MessageListFragment} which has the list to the
145
147
* messages
@@ -157,8 +159,6 @@ public class ZulipActivity extends BaseActivity implements
157
159
private static final int PERMISSION_REQUEST_READ_STORAGE = 1 ;
158
160
private static final int REQUEST_TAKE_PHOTO = 2 ;
159
161
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 ;
162
162
// row number which is used to differentiate the 'All private messages'
163
163
// row from the people
164
164
final int allPeopleId = -1 ;
@@ -570,9 +570,11 @@ public void showListDialog() {
570
570
dialog .show (getFragmentManager (), "ListDialogFragment" );
571
571
}
572
572
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
+ */
576
578
@ Override
577
579
public void onDialogPhotoClick (DialogFragment dialog ) {
578
580
// User touched the dialog's "Take picture" button
@@ -946,6 +948,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
946
948
if (data .getData () != null ) {
947
949
fileUris .add (data .getData ());
948
950
}
951
+ // intent.getClipData was added in api 16
949
952
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN ) {
950
953
ClipData clipData = data .getClipData ();
951
954
if (clipData != null ) {
@@ -1309,7 +1312,7 @@ private void setupFab() {
1309
1312
fab = (FloatingActionButton ) findViewById (R .id .fab );
1310
1313
chatBox = (SwipeRemoveLinearLayout ) findViewById (R .id .messageBoxContainer );
1311
1314
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 ) {
1313
1316
public void onTick (long millisUntilFinished ) {
1314
1317
}
1315
1318
@@ -2368,7 +2371,7 @@ private void dispatchPickIntent() {
2368
2371
}
2369
2372
2370
2373
if (intent .resolveActivity (getPackageManager ()) != null ) {
2371
- startActivityForResult (intent , REQUEST_PICK_FILE );
2374
+ startActivityForResult (intent , Constants . REQUEST_PICK_FILE );
2372
2375
// activity transition animation
2373
2376
ActivityTransitionAnim .transition (ZulipActivity .this );
2374
2377
}
0 commit comments