Skip to content

Commit

Permalink
删除没用功能
Browse files Browse the repository at this point in the history
  • Loading branch information
zjlong committed Apr 19, 2016
1 parent 1b89527 commit 501a266
Show file tree
Hide file tree
Showing 37 changed files with 676 additions and 613 deletions.
2 changes: 2 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
}

repositories {
maven { url "https://jitpack.matto" }
maven { url "https://jitpack.io" }
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</activity>
<activity android:name=".ui.activity.LoginActivity" />
<activity android:name=".ui.activity.MainActivity" />
<activity android:name=".ui.activity.AndroidSwipActivity" />
<activity android:name="com.common.view.base.WebViewActivity" />
</application>

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/matto/App.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.matto;

import com.common.EasyApplication;
import com.common.BasicApplication;
import com.common.model.control.LogicProxy;
import com.matto.model.LoginLogic;
import com.matto.model.MainLogic;
Expand All @@ -9,11 +9,12 @@
* author miekoz on 2016/3/17.
* email [email protected]
*/
public class App extends EasyApplication {
public class App extends BasicApplication {

@Override
public void onCreate() {
super.onCreate();

LogicProxy.getInstance().init(
LoginLogic.class, MainLogic.class
);
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/matto/model/config/ApiConstant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.matto.model.config;

/**
* author meikoz on 2016/4/19.
* email [email protected]
*/
public interface ApiConstant {

String BASE_URL = "http://gank.avosapps.com/api/";
}
7 changes: 2 additions & 5 deletions app/src/main/java/com/matto/model/http/ServiceFactory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.matto.model.http;

import com.common.model.http.HttpClient;
import com.matto.model.config.ApiConstant;
import com.matto.pojo.Gank;

import retrofit2.Call;
Expand All @@ -16,13 +17,9 @@ public class ServiceFactory {

public static MainService getMainIns(){
if (mService == null){
mService = HttpClient.getIns().createService(MainService.class);
mService = HttpClient.getIns(ApiConstant.BASE_URL).createService(MainService.class);
}
return mService;
}

public Call<Gank> getBenefitsGoods(int size, int page){
return mService.getMainAndroid(size,page);
}

}
21 changes: 21 additions & 0 deletions app/src/main/java/com/matto/ui/activity/AndroidSwipActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.matto.ui.activity;

import android.os.Bundle;

import com.common.view.base.SwipeBackActivity;
import com.common.view.base.SwipeBackLayout;
import com.matto.R;

/**
* author meikoz on 2016/4/19.
* email [email protected]
*/
public class AndroidSwipActivity extends SwipeBackActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_common);
setDragEdge(SwipeBackLayout.DragEdge.LEFT);
}
}
7 changes: 6 additions & 1 deletion app/src/main/java/com/matto/ui/activity/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.common.model.basic.ToastTip;
import com.common.view.base.BaseActivity;
import com.matto.ui.widget.TitleBar;
import com.matto.R;
import com.common.model.control.LogicProxy;
import com.matto.model.LoginLogic;
Expand All @@ -31,6 +32,9 @@ public static void start(Activity activity) {
@Bind(R.id.edit_passwrod)
EditText mEditPasswrod;

@Bind(R.id.title_bar)
TitleBar titlebar;

LoginLogic mLoginLogic;

@Override
Expand All @@ -40,18 +44,19 @@ protected int getLayoutResource() {

@Override
protected void onInitView() {
titlebar.setTitle("登录页面");
mLoginLogic = LogicProxy.getInstance().getBindViewProxy(LoginLogic.class, this);
}

@OnClick(R.id.btn_login)
void login() {
mLoginLogic.login("zhangsan", "123");
startActivity(new Intent(LoginActivity.this, AndroidSwipActivity.class));
}

@Override
public void onLoginSuccess() {
ToastTip.show("登录成功");
MainActivity.start(LoginActivity.this);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/matto/ui/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.matto.R;
import com.matto.model.MainLogic;
import com.matto.ui.fragment.DiscoveryFragment;
import com.matto.ui.fragment.HomeFragment;
import com.matto.ui.fragment.ShowMeFragment;
import com.matto.ui.view.MainView;

Expand Down Expand Up @@ -42,7 +43,7 @@ protected void onInitView() {

@Override
public void switchHome() {
startFragment(new DiscoveryFragment());
startFragment(new HomeFragment());
}

@Override
Expand Down
20 changes: 19 additions & 1 deletion app/src/main/java/com/matto/ui/fragment/HomeFragment.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
package com.matto.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import com.common.view.base.BaseFragment;
import com.common.view.widget.OnClickEvent;
import com.matto.R;
import com.matto.ui.activity.AndroidSwipActivity;
import com.matto.ui.activity.LoginActivity;

import butterknife.Bind;

/**
* author meikoz on 2016/4/19.
* email [email protected]
*/
public class HomeFragment extends BaseFragment {

@Bind(R.id.splash_view)
ImageView splashView;

@Override
protected int getLayoutResource() {
return R.layout.activity_spalsh;
}

@Override
protected void onInitData() {

splashView.setOnClickListener(new OnClickEvent() {
@Override
public void singleClick(View v) {
startActivity(new Intent(getActivity(), AndroidSwipActivity.class));
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class ShowMeFragment extends BaseFragment {
@Override
protected int getLayoutResource() {
return R.layout.activity_hosting;
return R.layout.activity_listview;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.common.view.base;
package com.matto.ui.widget;

import android.app.Activity;
import android.content.Context;
Expand All @@ -11,14 +11,14 @@
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.common.R;
import com.common.utils.DisplayUtil;
import com.matto.R;

/**
* author miekoz on 2016/3/15.
* email [email protected]
*/
public class EasyToolBar extends RelativeLayout implements View.OnClickListener {
public class TitleBar extends RelativeLayout implements View.OnClickListener {

LinearLayout mlvTitleRight;
TextView mTvTitle;
Expand All @@ -27,12 +27,12 @@ public class EasyToolBar extends RelativeLayout implements View.OnClickListener
private OnClickTitleBarBackCallback mCallBack;
private TextView mTvRightText;

public EasyToolBar(Context context) {
public TitleBar(Context context) {
super(context);
onInit();
}

public EasyToolBar(Context context, AttributeSet attrs) {
public TitleBar(Context context, AttributeSet attrs) {
super(context, attrs);
onInit();
TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.titlebarview);
Expand Down
Binary file added app/src/main/res/drawable-xxhdpi/app_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions app/src/main/res/layout/activity_common.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
android:orientation="vertical">

<include layout="@layout/view_tool_bar" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello_world" />

</LinearLayout>

3 changes: 3 additions & 0 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical">

<include layout="@layout/view_tool_bar"/>

<EditText
android:id="@+id/edit_username"
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<com.common.view.base.EasyToolBar
android:id="@+id/toolbar"
<com.matto.ui.widget.TitleBar
android:id="@+id/title_bar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"/>
8 changes: 4 additions & 4 deletions basic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
apply plugin: 'com.android.library'
repositories {
maven { url "https://jitpack.matto" }
}

android {
compileSdkVersion 23
Expand All @@ -21,7 +18,9 @@ android {
}
}


repositories {
maven { url "https://jitpack.io" }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
Expand All @@ -34,6 +33,7 @@ dependencies {
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.okhttp3:logging-interceptor:3.1.2'

// Glide
compile 'com.github.bumptech.glide:glide:3.7.0'
compile files('libs/BaiduLBS_Android.jar')
Expand Down
35 changes: 35 additions & 0 deletions basic/src/main/java/com/common/BasicApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.common;

import android.app.Application;
import android.content.Context;

import com.common.model.basic.LocationTip;

/**
* author miekoz on 2016/3/17.
* email [email protected]
*/
public class BasicApplication extends Application {

private static BasicApplication ourInstance = new BasicApplication();
private static Context mContext;

public static BasicApplication getInstance() {
return ourInstance;
}

public static Context getContext() {
return mContext;
}

@Override
public void onCreate() {
super.onCreate();
ourInstance = this;
mContext = getApplicationContext();

new LocationTip(this).doStartLocation();
}


}
49 changes: 0 additions & 49 deletions basic/src/main/java/com/common/EasyApplication.java

This file was deleted.

Loading

0 comments on commit 501a266

Please sign in to comment.