Skip to content

Commit

Permalink
Improve details
Browse files Browse the repository at this point in the history
  • Loading branch information
royaff0 committed Jul 22, 2017
1 parent 4da4855 commit cf4001c
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 35 deletions.
4 changes: 2 additions & 2 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.sqrtf.megumin"
minSdkVersion 19
targetSdkVersion 25
versionCode 4
versionName "0.4"
versionCode 5
versionName "0.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand Down
8 changes: 6 additions & 2 deletions mobile/src/main/java/com/sqrtf/megumin/FirstConfigActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ class FirstConfigActivity : BaseActivity() {
findViewById(R.id.floatingActionButton).setOnClickListener {
var url = textServer.text.toString()

if (url.isEmpty()){
showToast("Please enter domain")
return@setOnClickListener
}

if (HttpUrl.parse(url) == null) {
showToast("url not verified")
showToast("Url not verified")
return@setOnClickListener
}

showToast("请稍候...")

ApiClient.init(this, url)
ApiClient.getInstance().login(LoginRequest(textUser.text.toString(), textPw.text.toString(), true))
Expand Down
6 changes: 6 additions & 0 deletions mobile/src/main/res/drawable/button_red.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_red_normal" android:state_checked="false" />
<item android:drawable="@drawable/button_red_click" android:state_checked="true" />
<item android:drawable="@drawable/button_red_normal" />
</selector>
13 changes: 13 additions & 0 deletions mobile/src/main/res/drawable/button_red_click.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@color/meguminRedDark" />

<stroke
android:width="1dp"
android:color="@color/meguminRedDark" />

<corners android:radius="3dp" />

</shape>
13 changes: 13 additions & 0 deletions mobile/src/main/res/drawable/button_red_normal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@color/meguminRed" />

<stroke
android:width="1dp"
android:color="@color/meguminRed" />

<corners android:radius="3dp" />

</shape>
9 changes: 0 additions & 9 deletions mobile/src/main/res/drawable/side_nav_bar.xml

This file was deleted.

9 changes: 0 additions & 9 deletions mobile/src/main/res/drawable/side_nav_bar_red.xml

This file was deleted.

15 changes: 11 additions & 4 deletions mobile/src/main/res/layout/activity_first_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,28 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="64dp"
tools:context="com.sqrtf.megumin.FirstConfigActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="24dp"
android:text="@string/app_name"
android:textSize="24dp" />

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_margin="6dp">
android:layout_margin="6dp"
android:paddingTop="24dp">

<EditText
android:id="@+id/server"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:gravity="center_vertical"
android:hint="Host"
android:hint="Host (like https://xxx.xxx/)"
android:inputType="textUri"
android:paddingLeft="12dp"
android:paddingRight="12dp"
Expand Down Expand Up @@ -61,7 +68,7 @@
android:background="@null"
android:gravity="center_vertical"
android:hint="Password"
android:inputType="textVisiblePassword"
android:inputType="textPassword"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:singleLine="true"
Expand Down
16 changes: 10 additions & 6 deletions mobile/src/main/res/layout/content_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,26 @@

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginBottom="20dp"
android:layout_height="32dp"
android:layout_marginBottom="24dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="20dp">
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:background="@drawable/button_red"
android:gravity="center"
android:paddingLeft="8dp"
android:paddingRight="4dp">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_playlist_add_check_black_24dp"
android:tint="@color/colorAccent" />
android:tint="@color/textColorPrimary" />

<android.support.v7.widget.AppCompatSpinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:clickable="true"
android:focusable="true"
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/nav_header_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:background="@mipmap/nav_bg"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/res/layout/spinner_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
android:ellipsize="marquee"
android:singleLine="true"
android:textAlignment="inherit"
android:textColor="@color/colorAccent" />
android:textColor="@color/textColorPrimary" />
Binary file added mobile/src/main/res/mipmap-xxhdpi/nav_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion mobile/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="meguminRed">#d43b3e</color>
<!--<color name="aquaBlue">#5e9fdf</color>-->
<color name="meguminRedDark">#a92f31</color>
<color name="aquaBlue">#5e9fdf</color>

<color name="colorPrimary">#212121</color>
<color name="colorPrimaryDark">#181818</color>
Expand Down

0 comments on commit cf4001c

Please sign in to comment.