Skip to content

Commit

Permalink
main UI modified, add recent tab, add some missing res file at latest…
Browse files Browse the repository at this point in the history
… push.
  • Loading branch information
fan123199 committed Apr 5, 2017
1 parent 63f0e61 commit 47bec6b
Show file tree
Hide file tree
Showing 21 changed files with 128 additions and 17 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ The project guide me to start my project from zero.
##Change log


### v1.3

add recent tab. title color change

### v1.2

add


### v1.1 (2017.03.29)

add notification
Expand Down
3 changes: 1 addition & 2 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
Expand Down Expand Up @@ -91,7 +91,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "im.fdx.v2ex"
minSdkVersion 19
targetSdkVersion 25
versionCode 2
versionName "1.1"
versionCode 4
versionName "1.3"

}
lintOptions {
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/im/fdx/v2ex/ui/main/TopicsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
getTopicsJsonByVolley(mRequestURL);
} else if (mMNodeID == 0) {
if (mTabs != null && !mTabs.isEmpty())
mRequestURL = HTTPS_V2EX_BASE + "/?tab=" + mTabs;
if (mTabs.equals("recent")) {
mRequestURL = HTTPS_V2EX_BASE + "/recent";
} else {
mRequestURL = HTTPS_V2EX_BASE + "/?tab=" + mTabs;
}
getTopicsByOK(mRequestURL);
}

Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_arrow_back_primary_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ff00bcd4"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_block_primary_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/accent"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_block_white_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_favorite_border_primary_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_person_outline_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,5.9c1.16,0 2.1,0.94 2.1,2.1s-0.94,2.1 -2.1,2.1S9.9,9.16 9.9,8s0.94,-2.1 2.1,-2.1m0,9c2.97,0 6.1,1.46 6.1,2.1v1.1L5.9,18.1L5.9,17c0,-0.64 3.13,-2.1 6.1,-2.1M12,4C9.79,4 8,5.79 8,8s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,13c-2.67,0 -8,1.34 -8,4v3h16v-3c0,-2.66 -5.33,-4 -8,-4z" />
</vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/primary" />
<!--<solid android:color="@color/primary" />-->
<stroke
android:width="1dp"
android:color="@color/primary" />
<corners android:topLeftRadius="4dp"
android:topRightRadius="4dp"
android:bottomRightRadius="4dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
android:paddingBottom="8dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:background="@drawable/radio_with_color"
android:background="@drawable/radio_border"
android:text="@string/login" />
</FrameLayout>

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_main_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
android:id="@+id/sliding_tabs"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabMode="scrollable" />
android:layout_height="40dp" />

</android.support.design.widget.AppBarLayout>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_node.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
app:expandedTitleMarginTop="30dp"
app:expandedTitleMarginStart="115dp"
app:expandedTitleTextAppearance="@style/ExpendedCollapseTitle"
app:collapsedTitleTextAppearance="@style/CollapseTitle"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<RelativeLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:id="@+id/ctl_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:collapsedTitleTextAppearance="@style/MemberCollapseTitle"
app:collapsedTitleTextAppearance="@style/CollapseTitle"
app:expandedTitleMarginStart="126dp"
app:expandedTitleMarginTop="16dp"
app:expandedTitleGravity="top"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/item_topic_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_created"
android:layout_alignEnd="@+id/tv_title"
android:background="@drawable/radio_with_color"
android:elevation="2dp"
android:background="@drawable/radio_border"
android:textColor="@color/primary_dark"
app:elevation="2dp"
android:paddingBottom="2dp"
android:paddingEnd="6dp"
android:paddingStart="6dp"
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/menu/menu_member.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:title="Follow"
android:id="@+id/menu_follow"
android:icon="@drawable/ic_favorite_border_white_24dp"
app:showAsAction="ifRoom" />
<item
android:title="Block"
android:icon="@drawable/ic_block_white_24dp"
android:id="@+id/menu_block"
app:showAsAction="ifRoom" />
</menu>
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--use for background-->
<color name="list_background">#e8e8e8</color>
<color name="colorDivider">#B6B6B6</color>
<color name="title_color">#00BCD4</color>
<color name="title_color">@color/black</color>

<color name="black">#000000</color>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<string-array name="v2ex_favorite_tab_titles" translatable="false">
<item>最热</item>
<item>全部</item>
<item>最近</item>
<item>技术</item>
<item>创意</item>
<item>好玩</item>
Expand Down Expand Up @@ -83,6 +84,7 @@
<string-array name="v2ex_favorite_tab_paths" translatable="false">
<item>hot</item>
<item>all</item>
<item>recent</item>
<item>tech</item>
<item>creative</item>
<item>play</item>
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">?attr/colorAccent</item>
<!--<item name="tabBackground">?attr/colorPrimary</item>-->
<item name="tabPaddingStart">6dp</item>
<item name="tabPaddingEnd">6dp</item>
<item name="tabPaddingStart">1dp</item>
<item name="tabPaddingEnd">1dp</item>
<item name="tabMode">scrollable</item>
</style>

<style name="AppTheme.Light.Dialog" parent="Theme.AppCompat.Light.Dialog">
Expand All @@ -56,7 +57,7 @@
<!--<item name="android:maxWidth">20dp</item> not working-->
</style>

<style name="MemberCollapseTitle">
<style name="CollapseTitle">
<item name="android:textColor">@color/white</item>
</style>

Expand Down
32 changes: 32 additions & 0 deletions app/src/testDebug/java/im/fdx/v2ex/utils/SecureUtilsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package im.fdx.v2ex.utils;

import android.os.Build;
import android.support.annotation.RequiresApi;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Created by fdx on 2017/3/17.
*/
public class SecureUtilsTest {

// public SecureUtils utils = new SecureUtils();

//需要mock才能进行,失败
@RequiresApi(api = Build.VERSION_CODES.M)
@Test
public void encrypt() throws Exception {
// SecureUtils utils = new SecureUtils();
// String encrypt = utils.encrypt("what the fuck");
// String decrypt = utils.decrypt(encrypt);
// assertEquals("what the fuck", decrypt);
}

@Test
public void decrypt() throws Exception {

}

}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'org.greenrobot:greendao-gradle-plugin:3.1.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

Expand Down

0 comments on commit 47bec6b

Please sign in to comment.