forked from tome34/frameDemoMo2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
680 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-debug.apk","properties":{"packageId":"com.example.tome.framedemomo2","split":"","minSdkVersion":"17"}}] |
78 changes: 78 additions & 0 deletions
78
...nent_base/src/main/java/com/example/tome/component_base/base/mvc/BaseEmptyVcFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.example.tome.component_base.base.mvc; | ||
|
||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import com.example.tome.component_base.R; | ||
import com.example.tome.component_base.util.L; | ||
import com.example.tome.component_base.widget.emptyViews.EmptyView; | ||
|
||
/** | ||
* @author tome | ||
* @date 2018/7/9 16:30 | ||
* @describe ${处理空页面显示} | ||
*/ | ||
public abstract class BaseEmptyVcFragment extends BaseVcFragment{ | ||
private ViewGroup mNormalView; | ||
private ViewGroup mParent; | ||
public EmptyView mEmptyView; | ||
public View mEmptyGroup; | ||
|
||
//用getview获取不到 | ||
@Override | ||
protected void init(View view) { | ||
if (view == null) { | ||
return; | ||
} | ||
// mNormalView = (ViewGroup) view.findViewById(R.id.refresh_layout); | ||
mNormalView = getViewGroup(view); | ||
if (mNormalView == null) { | ||
throw new IllegalStateException( | ||
"The subclass of RootActivity must contain a View named 'mNormalView'."); | ||
} | ||
if (!(mNormalView.getParent() instanceof ViewGroup)) { | ||
throw new IllegalStateException( | ||
"mNormalView's ParentView should be a ViewGroup."); | ||
} | ||
//mParent = (ViewGroup) mNormalView.getParent(); 获取不到view | ||
mParent = (ViewGroup) mNormalView.getRootView(); | ||
View.inflate(mContext, R.layout.base_empty_view_fragment, mParent); | ||
mEmptyGroup = mParent.findViewById(R.id.empty_group); | ||
mEmptyView = (EmptyView)mEmptyGroup.findViewById(R.id.empty_view); | ||
mEmptyGroup.setVisibility(View.GONE); | ||
L.d("空布局++"+mEmptyView); | ||
} | ||
|
||
@Override | ||
public void showNormal() { | ||
mNormalView.setVisibility(View.VISIBLE); | ||
mEmptyView.hide(); | ||
mEmptyGroup.setVisibility(View.GONE); | ||
} | ||
|
||
@Override | ||
public void showLoading() { | ||
mNormalView.setVisibility(View.GONE); | ||
mEmptyView.show(); | ||
mEmptyGroup.setVisibility(View.VISIBLE); | ||
} | ||
|
||
@Override | ||
public void showEmptyView() { | ||
mNormalView.setVisibility(View.GONE); | ||
mEmptyView.hide(); | ||
mEmptyGroup.setVisibility(View.VISIBLE); | ||
mEmptyView.showEnpty(R.mipmap.icon_empty, "这里什么都没有哦", null ); | ||
|
||
} | ||
|
||
@Override | ||
public void showError() { | ||
mNormalView.setVisibility(View.GONE); | ||
mEmptyView.hide(); | ||
mEmptyGroup.setVisibility(View.VISIBLE); | ||
mEmptyView.showError(R.mipmap.error404,"出错了",null,"重新加载", null); | ||
} | ||
|
||
//由子类实现顶层布局id | ||
public abstract ViewGroup getViewGroup(View view); | ||
} |
49 changes: 49 additions & 0 deletions
49
component_base/src/main/java/com/example/tome/component_base/util/OtherUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.example.tome.component_base.util; | ||
|
||
import android.graphics.Color; | ||
import java.util.Random; | ||
|
||
/** | ||
* @author tome | ||
* @date 2018/7/11 16:58 | ||
* @describe ${其他的工具} | ||
*/ | ||
public class OtherUtils { | ||
|
||
/** | ||
* 获取随机rgb颜色值 | ||
*/ | ||
public static int randomColor(){ | ||
Random random = new Random(); | ||
//0-190, 如果颜色值过大,就越接近白色,就看不清了,所以需要限定范围 | ||
int red =random.nextInt(150); | ||
//0-190 | ||
int green =random.nextInt(150); | ||
//0-190 | ||
int blue =random.nextInt(150); | ||
//使用rgb混合生成一种新的颜色,Color.rgb生成的是一个int数 | ||
return Color.rgb(red,green, blue); | ||
} | ||
|
||
public static int randomTagColor() { | ||
int randomNum = new Random().nextInt(); | ||
int position = randomNum % TAB_COLORS.length; | ||
if (position < 0) { | ||
position = -position; | ||
} | ||
return TAB_COLORS[position]; | ||
} | ||
|
||
/** | ||
* Tab colors | ||
*/ | ||
public static final int[] TAB_COLORS = new int[]{ | ||
Color.parseColor("#90C5F0"), | ||
Color.parseColor("#91CED5"), | ||
Color.parseColor("#F88F55"), | ||
Color.parseColor("#C0AFD0"), | ||
Color.parseColor("#E78F8F"), | ||
Color.parseColor("#67CCB7"), | ||
Color.parseColor("#F6BC7E") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:color="@color/btn_ghost_blue_border_disabled" android:state_enabled="false" /> | ||
<item android:color="@color/btn_ghost_blue_border_pressed" android:state_pressed="true" /> | ||
<item android:color="@color/btn_ghost_blue_border_normal" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:color="@color/btn_ghost_blue_text_disabled" android:state_enabled="false" /> | ||
<item android:color="@color/btn_ghost_blue_text_pressed" android:state_pressed="true" /> | ||
<item android:color="@color/btn_ghost_blue_text_normal" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:color="@color/app_color_blue_disabled" android:state_enabled="false" /> | ||
<item android:color="@color/app_color_blue_pressed" android:state_pressed="true" /> | ||
<item android:color="@color/app_color_blue" /> | ||
</selector> |
15 changes: 15 additions & 0 deletions
15
component_base/src/main/res/drawable/empty_button_selector.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_pressed="false"> | ||
<shape> | ||
<solid android:color="@color/mainColor"/> | ||
<corners android:radius="8dp"/> | ||
</shape> | ||
</item> | ||
<item android:state_pressed="true"> | ||
<shape> | ||
<solid android:color="@color/colorE75"/> | ||
<corners android:radius="8dp"/> | ||
</shape> | ||
</item> | ||
</selector> |
24 changes: 24 additions & 0 deletions
24
component_base/src/main/res/layout/base_empty_view_fragment.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/empty_group" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
> | ||
|
||
<android.support.v4.widget.Space | ||
android:id="@+id/space" | ||
android:layout_width="@dimen/dp_1" | ||
android:layout_height="@dimen/dp_1" | ||
android:layout_centerInParent="true" /> | ||
|
||
<com.example.tome.component_base.widget.emptyViews.EmptyView | ||
android:id="@+id/empty_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:qmui_title_text="" | ||
app:qmui_detail_text="" | ||
> | ||
</com.example.tome.component_base.widget.emptyViews.EmptyView> | ||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<declare-styleable name="button_style"> | ||
<attr name="QMUIButtonStyle" format="reference"/> | ||
<attr name="qmui_alpha_pressed" format="float"/> | ||
<attr name="qmui_alpha_disabled" format="float"/> | ||
</declare-styleable> | ||
|
||
<!-- EmptyView start --> | ||
<declare-styleable name="QMUIEmptyView"> | ||
<attr name="qmui_show_loading" format="boolean"/> | ||
<attr name="qmui_image_view" format="integer"/> | ||
<attr name="qmui_title_text" format="string"/> | ||
<attr name="qmui_detail_text" format="string"/> | ||
<attr name="qmui_btn_text" format="string"/> | ||
</declare-styleable> | ||
<!-- EmptyView end --> | ||
|
||
<!--Loading--> | ||
<declare-styleable name="QMUILoadingStyle"> | ||
<attr name="LoadingStyle" format="reference"/> | ||
|
||
</declare-styleable> | ||
|
||
<!--************ QMUILoading ***********--> | ||
<declare-styleable name="LoadingView"> | ||
<attr name="qmui_loading_view_size" format="dimension"/> | ||
<attr name="qmui_loading_view_color" format="color"/> | ||
</declare-styleable> | ||
|
||
<!--圆角按钮--> | ||
<declare-styleable name="QMUIRoundButton"> | ||
<attr name="qmui_backgroundColor"/> | ||
<attr name="qmui_borderColor"/> | ||
<attr name="qmui_borderWidth"/> | ||
<attr name="qmui_isRadiusAdjustBounds"/> | ||
<attr name="qmui_radius"/> | ||
<attr name="qmui_radiusTopLeft"/> | ||
<attr name="qmui_radiusTopRight"/> | ||
<attr name="qmui_radiusBottomLeft"/> | ||
<attr name="qmui_radiusBottomRight"/> | ||
</declare-styleable> | ||
</resources> |
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
module_common_ui/src/main/res/drawable/qmui_tip_dialog_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle" > | ||
<solid android:color="@color/qmui_config_color_75_pure_black" /> | ||
<corners android:radius="15dp" /> | ||
</shape> |
96 changes: 96 additions & 0 deletions
96
module_shop_mall/src/main/java/com/example/tome/module_shop_mall/dao/DaoMaster.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package com.example.tome.module_shop_mall.dao; | ||
|
||
import android.content.Context; | ||
import android.database.sqlite.SQLiteDatabase; | ||
import android.database.sqlite.SQLiteDatabase.CursorFactory; | ||
import android.util.Log; | ||
|
||
import org.greenrobot.greendao.AbstractDaoMaster; | ||
import org.greenrobot.greendao.database.StandardDatabase; | ||
import org.greenrobot.greendao.database.Database; | ||
import org.greenrobot.greendao.database.DatabaseOpenHelper; | ||
import org.greenrobot.greendao.identityscope.IdentityScopeType; | ||
|
||
|
||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. | ||
/** | ||
* Master of DAO (schema version 1): knows all DAOs. | ||
*/ | ||
public class DaoMaster extends AbstractDaoMaster { | ||
public static final int SCHEMA_VERSION = 1; | ||
|
||
/** Creates underlying database table using DAOs. */ | ||
public static void createAllTables(Database db, boolean ifNotExists) { | ||
SearchHistoryBeanDao.createTable(db, ifNotExists); | ||
} | ||
|
||
/** Drops underlying database table using DAOs. */ | ||
public static void dropAllTables(Database db, boolean ifExists) { | ||
SearchHistoryBeanDao.dropTable(db, ifExists); | ||
} | ||
|
||
/** | ||
* WARNING: Drops all table on Upgrade! Use only during development. | ||
* Convenience method using a {@link DevOpenHelper}. | ||
*/ | ||
public static DaoSession newDevSession(Context context, String name) { | ||
Database db = new DevOpenHelper(context, name).getWritableDb(); | ||
DaoMaster daoMaster = new DaoMaster(db); | ||
return daoMaster.newSession(); | ||
} | ||
|
||
public DaoMaster(SQLiteDatabase db) { | ||
this(new StandardDatabase(db)); | ||
} | ||
|
||
public DaoMaster(Database db) { | ||
super(db, SCHEMA_VERSION); | ||
registerDaoClass(SearchHistoryBeanDao.class); | ||
} | ||
|
||
public DaoSession newSession() { | ||
return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); | ||
} | ||
|
||
public DaoSession newSession(IdentityScopeType type) { | ||
return new DaoSession(db, type, daoConfigMap); | ||
} | ||
|
||
/** | ||
* Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} - | ||
*/ | ||
public static abstract class OpenHelper extends DatabaseOpenHelper { | ||
public OpenHelper(Context context, String name) { | ||
super(context, name, SCHEMA_VERSION); | ||
} | ||
|
||
public OpenHelper(Context context, String name, CursorFactory factory) { | ||
super(context, name, factory, SCHEMA_VERSION); | ||
} | ||
|
||
@Override | ||
public void onCreate(Database db) { | ||
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION); | ||
createAllTables(db, false); | ||
} | ||
} | ||
|
||
/** WARNING: Drops all table on Upgrade! Use only during development. */ | ||
public static class DevOpenHelper extends OpenHelper { | ||
public DevOpenHelper(Context context, String name) { | ||
super(context, name); | ||
} | ||
|
||
public DevOpenHelper(Context context, String name, CursorFactory factory) { | ||
super(context, name, factory); | ||
} | ||
|
||
@Override | ||
public void onUpgrade(Database db, int oldVersion, int newVersion) { | ||
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables"); | ||
dropAllTables(db, true); | ||
onCreate(db); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.