Skip to content

Commit

Permalink
add app module
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMnter committed Jan 16, 2016
1 parent 0b04bba commit 758e9b7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ android {

// 渠道Flavors
productFlavors {
Fir {
manifestPlaceholders = [CHANNEL_NAME : "Fir",
UMENG_APPKEY: "569902f967e58e5e760003e1",
DEBUG : "T"]
}
// Fir {
// manifestPlaceholders = [CHANNEL_NAME : "Fir",
// UMENG_APPKEY: "569902f967e58e5e760003e1",
// DEBUG : "T"]
// }
DebugTest {
applicationId "com.camnter.easygank.test"
manifestPlaceholders = [CHANNEL_NAME: "DebugTest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void setType(int type) {
@Override
public int getRecycleViewItemType(int position) {
/*
* android、ios、js、resource是一套布局
* android、ios、js、resource、app是一套布局
*/
switch (this.type) {
case GankType.daily:
Expand All @@ -123,6 +123,7 @@ public int getRecycleViewItemType(int position) {
case GankType.js:
case GankType.resources:
case GankType.video:
case GankType.app:
return LAYOUT_TYPE_TECHNOLOGY;
case GankType.welfare:
return LAYOUT_TYPE_WELFARE;
Expand Down Expand Up @@ -207,7 +208,7 @@ private void loadingDaily(EasyRecyclerViewHolder easyRecyclerViewHolder, int pos
}

/**
* 加载技术类型数据 ( Android、iOS、前端、拓展资源 )
* 加载技术类型数据 ( Android、iOS、前端、拓展资源、App )
*
* @param easyRecyclerViewHolder easyRecyclerViewHolder
* @param position position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class GankTypeDict {
R.id.navigation_ios,
R.id.navigation_js,
R.id.navigation_video,
R.id.navigation_resources
R.id.navigation_resources,
R.id.navigation_app
};
public static final SparseArray<Integer> menuId2TypeDict = new SparseArray<>();

Expand All @@ -64,6 +65,7 @@ public class GankTypeDict {
menuId2TypeDict.put(R.id.navigation_js, GankType.js);
menuId2TypeDict.put(R.id.navigation_resources, GankType.resources);
menuId2TypeDict.put(R.id.navigation_video, GankType.video);
menuId2TypeDict.put(R.id.navigation_app, GankType.app);

type2UrlTypeDict.put(GankType.welfare, GankApi.DATA_TYPE_WELFARE);
type2UrlTypeDict.put(GankType.android, GankApi.DATA_TYPE_ANDROID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public void switchType(int type) {
case GankType.resources:
case GankType.welfare:
case GankType.video:
case GankType.app:
this.getData(type, true, oldPage);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ private void loadMore(int gankType) {
case GankType.resources:
case GankType.welfare:
case GankType.video:
case GankType.app:
this.presenter.getData(this.gankType, false, GankTypeDict.DONT_SWITCH);
break;
}
Expand Down Expand Up @@ -300,6 +301,7 @@ private void refreshData(int gankType) {
case GankType.resources:
case GankType.welfare:
case GankType.video:
case GankType.app:
this.presenter.getData(this.gankType, true, GankTypeDict.DONT_SWITCH);
break;
}
Expand Down Expand Up @@ -365,6 +367,7 @@ public void onSwitchSuccess(int type) {
case GankType.js:
case GankType.resources:
case GankType.video:
case GankType.app:
// 防止重复添加一样的
this.clearDecoration();
this.mainRv.setLayoutManager(this.mLinearLayoutManager);
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/menu/menu_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
android:id="@+id/navigation_resources"
android:icon="@mipmap/ic_resources"
android:title="@string/common_resources" />
<item
android:id="@+id/navigation_app"
android:icon="@mipmap/ic_app"
android:title="@string/common_app" />

</menu>
</item>
Expand Down
Binary file added app/src/main/res/mipmap-xhdpi/ic_app.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<string name="common_js">前端</string>
<string name="common_video">休息视频</string>
<string name="common_resources">拓展资源</string>
<string name="common_app">App</string>
<string name="common_via">via. %s</string>
<string name="common_via_key">via. </string>
<string name="common_go_back_tip">再按一次退出</string>
Expand Down

0 comments on commit 758e9b7

Please sign in to comment.