Skip to content

Commit

Permalink
界面细节上的一些调整
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Sep 24, 2016
1 parent d65b41f commit 4048cc4
Show file tree
Hide file tree
Showing 22 changed files with 510 additions and 271 deletions.
628 changes: 400 additions & 228 deletions .idea/workspace.xml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.njzjz.chemicaltools"
minSdkVersion 15
targetSdkVersion 23
versionCode 6
versionName "1.5"
versionCode 7
versionName "1.51"
}
buildTypes {
release {
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/njzjz/chemicaltools/ExamActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.njzjz.chemicaltools;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
Expand All @@ -15,6 +16,8 @@
import android.widget.EditText;
import android.widget.TextView;

import com.mikepenz.aboutlibraries.Libs;

public class ExamActivity extends AppCompatActivity {

@Override
Expand Down Expand Up @@ -170,6 +173,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_settings:
openSettings();
return true;
case R.id.action_Feedback:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:njzjz@msn.com?subject=Chemical Tools App Feedback"));
startActivity(browserIntent);
return true;
case R.id.action_About:
new Libs.Builder().withActivityTitle(getString(R.string.button_About)).withFields(R.string.class.getFields()).start(ExamActivity.this);
return true;
default:
return super.onOptionsItemSelected(item);
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/njzjz/chemicaltools/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
Expand All @@ -19,6 +20,8 @@
import android.widget.EditText;
import android.widget.TextView;

import com.mikepenz.aboutlibraries.Libs;

public class MainActivity extends AppCompatActivity {

@Override
Expand Down Expand Up @@ -120,6 +123,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_settings:
openSettings();
return true;
case R.id.action_Feedback:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:njzjz@msn.com?subject=Chemical Tools App Feedback"));
startActivity(browserIntent);
return true;
case R.id.action_About:
new Libs.Builder().withActivityTitle(getString(R.string.button_About)).withFields(R.string.class.getFields()).start(MainActivity.this);
return true;
default:
return super.onOptionsItemSelected(item);
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/njzjz/chemicaltools/MassActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
Expand All @@ -19,6 +20,8 @@
import android.widget.EditText;
import android.widget.TextView;

import com.mikepenz.aboutlibraries.Libs;

public class MassActivity extends AppCompatActivity {

@Override
Expand Down Expand Up @@ -271,6 +274,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_settings:
openSettings();
return true;
case R.id.action_Feedback:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:njzjz@msn.com?subject=Chemical Tools App Feedback"));
startActivity(browserIntent);
return true;
case R.id.action_About:
new Libs.Builder().withActivityTitle(getString(R.string.button_About)).withFields(R.string.class.getFields()).start(MassActivity.this);
return true;
default:
return super.onOptionsItemSelected(item);
}
Expand Down
24 changes: 17 additions & 7 deletions app/src/main/java/com/njzjz/chemicaltools/TitleActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.ikimuhendis.ldrawer.ActionBarDrawerToggle;
import com.ikimuhendis.ldrawer.DrawerArrowDrawable;
import com.mikepenz.aboutlibraries.Libs;

public class TitleActivity extends AppCompatActivity {
public final static String EXTRA_MESSAGE = "com.njzjz.chemicalTools.MESSAGE";
Expand Down Expand Up @@ -82,9 +83,10 @@ public void onDrawerOpened(View drawerView) {
res.getString(R.string.button_element),
res.getString(R.string.button_mass),
res.getString(R.string.button_exam),
res.getString(R.string.button_Settings),
res.getString(R.string.button_Share),
res.getString(R.string.button_Github),
res.getString(R.string.button_Settings),
res.getString(R.string.setting_feedback),
res.getString(R.string.button_About),
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, android.R.id.text1, values);
Expand All @@ -103,11 +105,11 @@ public void onItemClick(AdapterView<?> parent, View view,
openMass(view);
break;
case 5:
//Github
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/njzjz/Chemical-Tools-for-Android"));
//Feedback
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:njzjz@msn.com?subject=Chemical Tools App Feedback"));
startActivity(browserIntent);
break;
case 4:
case 3:
//Share
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
Expand All @@ -123,12 +125,13 @@ public void onItemClick(AdapterView<?> parent, View view,
//Exam
openExam(view);
break;
case 3:
case 4:
//Settings
openSettings();
break;
case 6:

//About
new Libs.Builder().withActivityTitle(getString(R.string.button_About)).withFields(R.string.class.getFields()).start(TitleActivity.this);
break;
}

Expand Down Expand Up @@ -161,6 +164,13 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.action_settings:
openSettings();
return true;
case R.id.action_Feedback:
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:njzjz@msn.com?subject=Chemical Tools App Feedback"));
startActivity(browserIntent);
return true;
case R.id.action_About:
new Libs.Builder().withActivityTitle(getString(R.string.button_About)).withFields(R.string.class.getFields()).start(TitleActivity.this);
return true;
default:
return super.onOptionsItemSelected(item);
}
Expand Down
Binary file removed app/src/main/res/drawable/element.jpg
Binary file not shown.
Binary file removed app/src/main/res/drawable/mass.jpg
Binary file not shown.
8 changes: 4 additions & 4 deletions app/src/main/res/drawable/selectable_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item><!-- 阴影效果 -->
<shape android:shape="rectangle" >
<corners android:radius="15dp" />
<corners android:radius="2dp" />
<solid android:color="@color/white" /><!-- 阴影的颜色 -->
</shape>
</item>

<item android:state_focused="true" android:state_pressed="false">
<shape android:shape="rectangle" >
<corners android:radius="15dp" />
<corners android:radius="2dp" />
<solid android:color="@color/super_light_grey" /><!-- 阴影的颜色 -->
</shape>
</item>
<item android:drawable="@color/super_light_grey" android:state_pressed="true">
<shape android:shape="rectangle" >
<corners android:radius="15dp" />
<corners android:radius="2dp" />
<solid android:color="@color/super_light_grey" /><!-- 阴影的颜色 -->
</shape>
</item>
<item android:drawable="@color/white" android:state_focused="false" android:state_pressed="false">
<shape android:shape="rectangle" >
<corners android:radius="15dp" />
<corners android:radius="2dp" />
<solid android:color="@color/white" /><!-- 阴影的颜色 -->
</shape>
</item>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/shadow_drawable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#000000"
android:endColor="#FFFFFF"
android:angle="270"
/>
</shape>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
android:id="@+id/elementTextview"
android:layout_weight="0.06"
android:text="@string/elementTextview_name"
android:textSize="25dp"
android:textSize="18dp"
android:textColor="@color/abc_primary_text_material_light"
android:scrollbars="vertical"
/>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_mass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
android:id="@+id/massTextview"
android:layout_weight="0.06"
android:text="@string/massTextview_name"
android:textSize="25dp"
android:textSize="18dp"
android:textColor="@color/abc_primary_text_material_light"
android:layout_below="@+id/relativeLayout1"
android:layout_centerHorizontal="true"
Expand Down
32 changes: 22 additions & 10 deletions app/src/main/res/layout/list_item_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginTop="8dp"
>
<ImageView
android:id="@+id/list_item_card_pic"
Expand All @@ -22,7 +22,7 @@
android:scaleType="centerCrop"
app:srcCompat="@drawable/ic_launcher"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_marginTop="0dp"
android:layout_height="25dp" />

<TextView
Expand All @@ -32,21 +32,28 @@
android:layout_height="wrap_content"
android:gravity="left"
android:layout_gravity="left"
android:textSize="20dp"
android:textSize="16dp"
android:minLines="1"
/>
</LinearLayout>

<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
>
<TextView
android:id="@+id/list_item_card_text2"
style="@style/ListItemText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17dp"
android:textSize="14sp"
android:layout_gravity="center_horizontal"
android:gravity="left|center_vertical"
android:minLines="3"
/>
/>
</LinearLayout>

<View
android:id="@+id/list_item_seperator"
Expand All @@ -66,26 +73,31 @@
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_margin="3dip"
android:layout_weight="0.5"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="@string/button_Share"
android:textSize="12sp"
android:textSize="14dp"
android:textStyle="normal" />

<Button
android:id="@+id/list_item_card_button_2"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_margin="3dip"
android:layout_weight="0.5"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="@string/button_open"
android:textSize="12sp"
android:textSize="14sp"
android:textStyle="normal" />
</LinearLayout>
<View
android:id="@+id/shadow"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="@drawable/shadow_drawable"/>

</LinearLayout>
16 changes: 12 additions & 4 deletions app/src/main/res/menu/mainmenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@

<item
android:id="@+id/action_share"
android:icon="@android:drawable/ic_menu_share"
android:icon="@drawable/ic_menu_share"
android:tint="#FFFFFF"
android:title="@string/button_Share"
app:showAsAction="always" />
<item
android:id="@+id/action_settings"
android:icon="@android:drawable/ic_menu_manage"
android:title="@string/button_Share"
app:showAsAction="always" />
android:title="@string/button_Settings"
app:showAsAction="never" />
<item
android:id="@+id/action_Feedback"
android:title="@string/setting_feedback"
app:showAsAction="never" />
<item
android:id="@+id/action_About"
android:title="@string/button_About"
app:showAsAction="never" />
</menu>
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Binary file not shown.
Loading

0 comments on commit 4048cc4

Please sign in to comment.