Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
//apply plugin: 'com.neenbedankt.android-apt'

/*
* Copyright 2017 Phillip Hsu
Expand Down Expand Up @@ -44,12 +44,12 @@ android {
storePassword keystoreProperties['storePassword']
}
}
compileSdkVersion 25
buildToolsVersion "24.0.3"
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId 'com.philliphsu.clock2'
minSdkVersion 19
targetSdkVersion 25
targetSdkVersion 27
versionCode 113
versionName "1.1.3"
// Disabled for now because we're not ready to
Expand Down Expand Up @@ -79,18 +79,19 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
provided 'com.google.auto.value:auto-value:1.2'
apt 'com.google.auto.value:auto-value:1.2'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:gridlayout-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile('com.philliphsu:bottomsheetpickers:2.3.2') {
implementation "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation('com.philliphsu:bottomsheetpickers:2.4.1') {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'gridlayout-v7'
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/philliphsu/clock2/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import android.support.v7.widget.Toolbar;
import android.view.Menu;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
Expand All @@ -40,7 +41,7 @@
public abstract class BaseActivity extends AppCompatActivity {

@Nullable
@Bind(R.id.toolbar)
@BindView(R.id.toolbar)
Toolbar mToolbar;

private Menu mMenu;
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/philliphsu/clock2/BaseFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.view.ViewGroup;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
* Created by Phillip Hsu on 6/30/2016.
Expand All @@ -44,19 +45,21 @@ public BaseFragment() {}
*/
@LayoutRes
protected abstract int contentLayout();
Unbinder unbinder;

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(contentLayout(), container, false);
ButterKnife.bind(this, view);
unbinder = ButterKnife.bind(this, view);
return view;
}

@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.unbind(this); // Only for fragments!
unbinder.unbind(); // Only for fragments!
}

/**
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/philliphsu/clock2/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
import com.philliphsu.clock2.timepickers.Utils;
import com.philliphsu.clock2.timers.ui.TimersFragment;

import butterknife.Bind;

import butterknife.BindView;

import static com.philliphsu.clock2.list.RecyclerViewFragment.ACTION_SCROLL_TO_STABLE_ID;
import static com.philliphsu.clock2.list.RecyclerViewFragment.EXTRA_SCROLL_TO_STABLE_ID;
Expand All @@ -66,13 +67,13 @@ public class MainActivity extends BaseActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private Drawable mAddItemDrawable;

@Bind(R.id.container)
@BindView(R.id.container)
ViewPager mViewPager;

@Bind(R.id.fab)
@BindView(R.id.fab)
FloatingActionButton mFab;

@Bind(R.id.tabs)
@BindView(R.id.tabs)
TabLayout mTabLayout;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@

import java.util.Date;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.OnCheckedChanged;
import butterknife.OnClick;
import butterknife.OnTouch;
Expand All @@ -76,10 +77,10 @@ public abstract class BaseAlarmViewHolder extends BaseViewHolder<Alarm> {

final FragmentManager mFragmentManager;

@Bind(R.id.time) TextView mTime;
@Bind(R.id.on_off_switch) SwitchCompat mSwitch;
@Bind(R.id.label) TextView mLabel;
@Bind(R.id.dismiss) Button mDismissButton;
@BindView(R.id.time) TextView mTime;
@BindView(R.id.on_off_switch) SwitchCompat mSwitch;
@BindView(R.id.label) TextView mLabel;
@BindView(R.id.dismiss) Button mDismissButton;

public BaseAlarmViewHolder(ViewGroup parent, @LayoutRes int layoutRes,
OnListItemInteractionListener<Alarm> listener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import com.philliphsu.clock2.alarms.misc.AlarmController;
import com.philliphsu.clock2.alarms.misc.DaysOfWeek;

import butterknife.Bind;

import butterknife.BindView;

import static android.view.View.GONE;
import static android.view.View.VISIBLE;
Expand All @@ -39,8 +40,8 @@
*/
public class CollapsedAlarmViewHolder extends BaseAlarmViewHolder {

@Bind(R.id.countdown) AlarmCountdown mCountdown;
@Bind(R.id.recurring_days) TextView mDays; // TODO: use `new DateFormatSymbols().getShortWeekdays()` to set texts
@BindView(R.id.countdown) AlarmCountdown mCountdown;
@BindView(R.id.recurring_days) TextView mDays; // TODO: use `new DateFormatSymbols().getShortWeekdays()` to set texts

public CollapsedAlarmViewHolder(ViewGroup parent, OnListItemInteractionListener<Alarm> listener,
AlarmController alarmController) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
import com.philliphsu.clock2.timepickers.Utils;
import com.philliphsu.clock2.util.FragmentTagUtils;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.BindViews;
import butterknife.OnClick;

/**
Expand All @@ -52,11 +54,11 @@
public class ExpandedAlarmViewHolder extends BaseAlarmViewHolder {
private static final String TAG = "ExpandedAlarmViewHolder";

@Bind(R.id.ok) Button mOk;
@Bind(R.id.delete) Button mDelete;
@Bind(R.id.ringtone) Button mRingtone;
@Bind(R.id.vibrate) TempCheckableImageButton mVibrate;
@Bind({R.id.day0, R.id.day1, R.id.day2, R.id.day3, R.id.day4, R.id.day5, R.id.day6})
@BindView(R.id.ok) Button mOk;
@BindView(R.id.delete) Button mDelete;
@BindView(R.id.ringtone) Button mRingtone;
@BindView(R.id.vibrate) TempCheckableImageButton mVibrate;
@BindViews({R.id.day0, R.id.day1, R.id.day2, R.id.day3, R.id.day4, R.id.day5, R.id.day6})
ToggleButton[] mDays;

private final ColorStateList mDayToggleColors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
import com.philliphsu.clock2.data.BaseItemCursor;
import com.philliphsu.clock2.data.ObjectWithId;

import butterknife.Bind;

import butterknife.BindView;

/**
* Created by Phillip Hsu on 7/26/2016.
Expand All @@ -60,11 +61,11 @@ public abstract class RecyclerViewFragment<

// TODO: Rename id to recyclerView?
// TODO: Rename variable to mRecyclerView?
@Bind(R.id.list)
@BindView(R.id.list)
RecyclerView mList;

@Nullable // Subclasses are not required to use the default content layout, so this may not be present.
@Bind(R.id.empty_view)
@BindView(R.id.empty_view)
TextView mEmptyView;

public abstract void onFabClick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import com.philliphsu.clock2.util.LocalBroadcastHelper;
import com.philliphsu.clock2.util.ParcelableUtil;

import butterknife.Bind;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

Expand All @@ -58,13 +58,13 @@ public abstract class RingtoneActivity<T extends Parcelable> extends BaseActivit
private static boolean sIsAlive = false;
private T mRingingObject;

@Bind(R.id.title) TextView mHeaderTitle;
@Bind(R.id.auto_silenced_container) LinearLayout mAutoSilencedContainer;
@Bind(R.id.auto_silenced_text) TextView mAutoSilencedText;
@Bind(R.id.ok) Button mOkButton;
@Bind(R.id.buttons_container) LinearLayout mButtonsContainer;
@Bind(R.id.btn_text_left) TextView mLeftButton;
@Bind(R.id.btn_text_right) TextView mRightButton;
@BindView(R.id.title) TextView mHeaderTitle;
@BindView(R.id.auto_silenced_container) LinearLayout mAutoSilencedContainer;
@BindView(R.id.auto_silenced_text) TextView mAutoSilencedText;
@BindView(R.id.ok) Button mOkButton;
@BindView(R.id.buttons_container) LinearLayout mButtonsContainer;
@BindView(R.id.btn_text_left) TextView mLeftButton;
@BindView(R.id.btn_text_right) TextView mRightButton;

protected abstract Class<? extends RingtoneService> getRingtoneServiceClass();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
import com.philliphsu.clock2.R;
import com.philliphsu.clock2.stopwatch.Lap;

import butterknife.Bind;
import butterknife.BindView;


/**
* Created by Phillip Hsu on 8/8/2016.
*/
public class LapViewHolder extends BaseViewHolder<Lap> {

@Bind(R.id.lap_number) TextView mLapNumber;
@Bind(R.id.elapsed_time) ChronometerWithMillis mElapsedTime;
@Bind(R.id.total_time) TextView mTotalTime;
@BindView(R.id.lap_number) TextView mLapNumber;
@BindView(R.id.elapsed_time) ChronometerWithMillis mElapsedTime;
@BindView(R.id.total_time) TextView mTotalTime;

public LapViewHolder(ViewGroup parent) {
super(parent, R.layout.item_lap, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@

import java.lang.ref.WeakReference;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.OnClick;

/**
Expand All @@ -73,10 +74,10 @@ public class StopwatchFragment extends RecyclerViewFragment<
private Drawable mStartDrawable;
private Drawable mPauseDrawable;

@Bind(R.id.chronometer) ChronometerWithMillis mChronometer;
@Bind(R.id.new_lap) ImageButton mNewLapButton;
@Bind(R.id.stop) ImageButton mStopButton;
@Bind(R.id.seek_bar) SeekBar mSeekBar;
@BindView(R.id.chronometer) ChronometerWithMillis mChronometer;
@BindView(R.id.new_lap) ImageButton mNewLapButton;
@BindView(R.id.stop) ImageButton mStopButton;
@BindView(R.id.seek_bar) SeekBar mSeekBar;

/**
* This is called only when a new instance of this Fragment is being created,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
import com.philliphsu.clock2.R;
import com.philliphsu.clock2.util.FragmentTagUtils;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.OnClick;
import butterknife.OnLongClick;
import butterknife.OnTouch;
Expand All @@ -55,19 +56,19 @@ public class EditTimerActivity extends BaseActivity implements AddLabelDialog.On

private AddLabelDialogController mAddLabelDialogController;

@Bind(R.id.edit_fields_layout) ViewGroup mEditFieldsLayout;
@Bind(R.id.label) TextView mLabel;
@Bind(R.id.hour) EditText mHour;
@Bind(R.id.minute) EditText mMinute;
@Bind(R.id.second) EditText mSecond;
@Bind(R.id.hour_label) TextView mHourLabel;
@Bind(R.id.minute_label) TextView mMinuteLabel;
@Bind(R.id.second_label) TextView mSecondLabel;
@Bind(R.id.focus_grabber) View mFocusGrabber;
@Bind(R.id.fab) FloatingActionButton mFab;
@BindView(R.id.edit_fields_layout) ViewGroup mEditFieldsLayout;
@BindView(R.id.label) TextView mLabel;
@BindView(R.id.hour) EditText mHour;
@BindView(R.id.minute) EditText mMinute;
@BindView(R.id.second) EditText mSecond;
@BindView(R.id.hour_label) TextView mHourLabel;
@BindView(R.id.minute_label) TextView mMinuteLabel;
@BindView(R.id.second_label) TextView mSecondLabel;
@BindView(R.id.focus_grabber) View mFocusGrabber;
@BindView(R.id.fab) FloatingActionButton mFab;
// Intentionally not using a (subclass of) GridLayoutNumpad, because
// it is expedient to not adapt it for timers.
@Bind(R.id.numpad) GridLayout mNumpad;
@BindView(R.id.numpad) GridLayout mNumpad;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
import com.philliphsu.clock2.util.FragmentTagUtils;
import com.philliphsu.clock2.util.ProgressBarUtils;

import butterknife.Bind;

import butterknife.BindView;
import butterknife.OnClick;

/**
Expand All @@ -63,13 +64,13 @@ public class TimerViewHolder extends BaseViewHolder<Timer> {
private final PopupMenu mPopupMenu;
private final AddLabelDialogController mAddLabelDialogController;

@Bind(R.id.label) TextView mLabel;
@Bind(R.id.duration) CountdownChronometer mChronometer;
@Bind(R.id.seek_bar) SeekBar mSeekBar;
@Bind(R.id.add_one_minute) TextView mAddOneMinute;
@Bind(R.id.start_pause) ImageButton mStartPause;
@Bind(R.id.stop) ImageButton mStop;
@Bind(R.id.menu) ImageButton mMenuButton;
@BindView(R.id.label) TextView mLabel;
@BindView(R.id.duration) CountdownChronometer mChronometer;
@BindView(R.id.seek_bar) SeekBar mSeekBar;
@BindView(R.id.add_one_minute) TextView mAddOneMinute;
@BindView(R.id.start_pause) ImageButton mStartPause;
@BindView(R.id.stop) ImageButton mStop;
@BindView(R.id.menu) ImageButton mMenuButton;

public TimerViewHolder(ViewGroup parent, OnListItemInteractionListener<Timer> listener,
AsyncTimersTableUpdateHandler asyncTimersTableUpdateHandler) {
Expand Down
Loading