Added NoneSecurityFragment

This commit is contained in:
Severiano Jaramillo 2018-01-21 14:57:09 -06:00
parent 2c46b509dc
commit 38938bdff7
6 changed files with 74 additions and 8 deletions

View file

@ -0,0 +1,38 @@
package cy.agorise.crystalwallet.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import cy.agorise.crystalwallet.R;
/**
* Created by xd on 1/18/18.
*/
public class NoneSecurityFragment extends Fragment {
public NoneSecurityFragment() {
// Required empty public constructor
}
public static NoneSecurityFragment newInstance() {
NoneSecurityFragment fragment = new NoneSecurityFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_none_security, container, false);
ButterKnife.bind(this, v);
return v;
}
}

View file

@ -5,7 +5,6 @@ import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -17,6 +16,7 @@ import cy.agorise.crystalwallet.util.ChildViewPager;
/**
* Created by xd on 1/17/18.
* In this fragment the user should be able to select its preferred security option.
*/
public class SecuritySettingsFragment extends Fragment {
@ -65,7 +65,7 @@ public class SecuritySettingsFragment extends Fragment {
public Fragment getItem(int position) {
switch (position){
case 0:
//return new GeneralSettingsFragment();
return new NoneSecurityFragment();
case 1:
return new PinSecurityFragment();
case 2:

View file

@ -7,6 +7,8 @@ import android.view.MotionEvent;
/**
* Created by xd on 1/18/18.
* This ViewPager is intended to be used inside another ViewPager therefore it has the
* setSwipeLocked which disables or enables the swipe gesture.
*/
@ -44,5 +46,4 @@ public class ChildViewPager extends ViewPager {
public boolean canScrollHorizontally(int direction) {
return !swipeLocked && super.canScrollHorizontally(direction);
}
}

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="It is recommended to use some kind of security."
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View file

@ -29,6 +29,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabSelectedTextColor="@color/black"
app:tabTextColor="@color/black"
android:animateLayoutChanges="true">
@ -36,19 +37,19 @@
android:id="@+id/tabNone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="None" />
android:text="@string/none" />
<android.support.design.widget.TabItem
android:id="@+id/tabPin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pin" />
android:text="@string/pin" />
<android.support.design.widget.TabItem
android:id="@+id/tabPattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pattern" />
android:text="@string/pattern" />
</android.support.design.widget.TabLayout>
@ -77,7 +78,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginStart="24dp"
android:text="Use &quot;Pocket&quot; Security"
android:text="@string/use_pocket_security"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@+id/vPocketSecurity"
@ -106,8 +107,10 @@
android:id="@+id/etPocketPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:inputType="numberPassword"
app:layout_constraintTop_toBottomOf="@id/tvPocketSecurityUser"
app:layout_constraintStart_toStartOf="@id/tvPocketSecurity"
app:layout_constraintEnd_toEndOf="@id/sPocketSecurity"/>
app:layout_constraintEnd_toEndOf="@id/sPocketSecurity"
tools:ignore="LabelFor" />
</android.support.constraint.ConstraintLayout>

View file

@ -492,4 +492,8 @@
<string name="current_pin">Current PIN</string>
<string name="new_pin">New PIN</string>
<string name="confirm_pin">Confirm PIN</string>
<string name="use_pocket_security">Use \"Pocket\" Security</string>
<string name="none">None</string>
<string name="pin">Pin</string>
<string name="pattern">Pattern</string>
</resources>