This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MistakesActivity extends ActionBarActivity { | |
| public static final String TABLE_NAME = "names"; | |
| private LoadTask loadTask; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_mistakes); | |
| loadTask=new LoadTask(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MistakesActivity extends ActionBarActivity { | |
| ///provides a CRUD interface, uses SQLiteDatabase under the hood, RxJava | |
| private IRepository dataRepository; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_mistakes); | |
| dataRepository=new Repository(context); //a better approach would be using a dependency injection framework | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Nullable | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | |
| View root=inflater.inflate(authLayout(),container,false); | |
| ButterKnife.bind(this,root); | |
| KeyboardVisibilityEvent.setEventListener(getActivity(), isOpen -> { | |
| callback.scale(isOpen); | |
| if(!isOpen){ | |
| clearFocus(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @OnClick(R.id.caption) | |
| public void unfold(){ | |
| if(!lock) { | |
| caption.setVerticalText(false); | |
| caption.requestLayout(); | |
| Rotate transition = new Rotate(); | |
| transition.setStartAngle(-90f); | |
| transition.setEndAngle(0f); | |
| transition.addTarget(caption); | |
| TransitionSet set=new TransitionSet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set.addListener(new Transition.TransitionListenerAdapter(){ | |
| @Override | |
| public void onTransitionEnd(Transition transition) { | |
| caption.setTranslationX(getTextPadding()); | |
| caption.setRotation(0); | |
| caption.setVerticalText(true); | |
| caption.requestLayout(); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public void fold() { | |
| //release the lock, so you can click on the label again and get the unfold() animation running | |
| lock = false; | |
| TransitionSet set = new TransitionSet(); | |
| set.setDuration(getResources().getInteger(R.integer.duration)); | |
| //simple rotate transition | |
| Rotate transition = new Rotate(); | |
| //at the end of the transiton our view will have -90 angle | |
| transition.setEndAngle(-90f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| views.forEach(editText -> { | |
| if (editText.getId() == R.id.password_input_edit) { | |
| final TextInputLayout inputLayout = ButterKnife.findById(view, R.id.password_input); | |
| final TextInputLayout confirmLayout = ButterKnife.findById(view, R.id.confirm_password); | |
| Typeface boldTypeface = Typeface.defaultFromStyle(Typeface.BOLD); | |
| inputLayout.setTypeface(boldTypeface); | |
| confirmLayout.setTypeface(boldTypeface); | |
| editText.addTextChangedListener(new TextWatcherAdapter() { | |
| @Override | |
| public void afterTextChanged(Editable editable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <corners android:radius="50dp"/> <!-- Change this line here to 0dp --> | |
| <stroke android:color="#87eeeeee"/> | |
| <solid android:color="#87eeeeee"/> | |
| </shape> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <android.support.constraint.ConstraintLayout | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:id="@+id/root" | |
| tools:background="@color/color_sign_up" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent"> | |
| <android.support.constraint.Guideline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthAdapter extends FragmentStatePagerAdapter | |
| implements AuthFragment.Callback { | |
| private final AnimatedViewPager pager; | |
| private final SparseArray<AuthFragment> authArray; | |
| private final List<ImageView> sharedElements; | |
| private final ImageView authBackground; | |
| private float factor; | |
| public AuthAdapter(FragmentManager manager, AnimatedViewPager pager, |