Create LicenseActivity and blue and green button styles

This commit is contained in:
Severiano Jaramillo 2018-05-25 11:47:00 -05:00
parent 9989fbbb74
commit 5b341fb018
10 changed files with 118 additions and 12 deletions

View file

@ -16,15 +16,17 @@
android:supportsRtl="true" android:supportsRtl="true"
android:configChanges="locale" android:configChanges="locale"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".activities.IntroActivity" <activity android:name=".activities.LicenseActivity">
android:theme="@style/AppTheme.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activities.IntroActivity"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity android:name=".activities.BoardActivity" <activity android:name=".activities.BoardActivity"
android:theme="@style/AppTheme.NoActionBar" > android:theme="@style/AppTheme.NoActionBar" >
</activity> </activity>

View file

@ -0,0 +1,38 @@
package cy.agorise.crystalwallet.activities;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R;
public class LicenseActivity extends AppCompatActivity {
@BindView(R.id.wvEULA) WebView wvEULA;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_license);
ButterKnife.bind(this);
// TODO check if license has been agreed
String html = getString(R.string.licence_html);
wvEULA.loadData(html, "text/html", "UTF-8");
}
@OnClick(R.id.btnAgree)
public void onAgree() {
// TODO send user to Intro activity if no active account or to Board activity otherwise
}
@OnClick(R.id.btnDisAgree)
public void onDisagree() {
finish();
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:drawable="@color/redcolor"/> <item android:state_enabled="true" android:drawable="@color/redColor"/>
<item android:state_enabled="false" android:drawable="@color/gray"/> <item android:state_enabled="false" android:drawable="@color/gray"/>
</selector> </selector>

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:background="@android:color/darker_gray"
tools:context="cy.agorise.crystalwallet.activities.LicenseActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<WebView
android:id="@+id/wvEULA"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</WebView>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@android:color/white"
android:clipToPadding="false"
android:padding="4dp"
android:orientation="horizontal">
<Button
android:id="@+id/btnDisAgree"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:layout_marginEnd="8dp"
android:theme="@style/RedButton"
android:textColor="@color/white"
android:textSize="14sp"
android:text="@string/disagree" />
<Button
android:id="@+id/btnAgree"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_marginStart="8dp"
android:theme="@style/BlueButton"
android:text="@string/agree"
android:textSize="14sp"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>

View file

@ -85,7 +85,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:layout_marginTop="48dp" android:layout_marginTop="48dp"
android:background="@color/redcolor" android:background="@color/redColor"
android:text="@string/cancel" android:text="@string/cancel"
android:textColor="@color/white" android:textColor="@color/white"
android:textStyle="bold" android:textStyle="bold"

View file

@ -101,7 +101,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:background="@color/redcolor" android:background="@color/redColor"
android:text="@string/remove" android:text="@string/remove"
android:textColor="@color/white" android:textColor="@color/white"
android:textStyle="bold" android:textStyle="bold"

View file

@ -56,7 +56,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32dp" android:layout_marginTop="32dp"
android:background="@color/redcolor" android:background="@color/redColor"
android:text="@string/dialog_cancel" android:text="@string/dialog_cancel"
android:textAllCaps="false" android:textAllCaps="false"
android:textColor="@color/white" android:textColor="@color/white"

View file

@ -19,7 +19,7 @@
<color name="greencolor">#70882E</color> <color name="greencolor">#70882E</color>
<color name="red">#ff0000</color> <color name="red">#ff0000</color>
<color name="pinkColor">#FF4081</color> <color name="pinkColor">#FF4081</color>
<color name="redcolor">#DD4739</color> <color name="redColor">#DD4739</color>
<color name="textColorPrimary">#FFFFFF</color> <color name="textColorPrimary">#FFFFFF</color>
<color name="windowBackground">#FFFFFF</color> <color name="windowBackground">#FFFFFF</color>
@ -27,7 +27,6 @@
<color name="bottomBarColor">#dddddd</color> <color name="bottomBarColor">#dddddd</color>
<color name="blackColor">#000000</color>
<color name="whiteColor">#ffffff</color> <color name="whiteColor">#ffffff</color>
<color name="receive_amount">#669900</color> <color name="receive_amount">#669900</color>
<color name="receive_amount_light">#c5e1a5</color> <color name="receive_amount_light">#c5e1a5</color>

File diff suppressed because one or more lines are too long

View file

@ -105,4 +105,18 @@
<item name="android:minHeight">16dp</item> <item name="android:minHeight">16dp</item>
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
</style> </style>
<style name="BlueButton" parent="Theme.AppCompat">
<item name="colorAccent">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimaryDark</item>
<item name="colorButtonNormal">@color/gray</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
</style>
<style name="RedButton" parent="Theme.AppCompat">
<item name="colorAccent">@color/red</item>
<item name="colorControlHighlight">@color/redColor</item>
<item name="colorButtonNormal">@color/gray</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
</style>
</resources> </resources>