Skip to content

Commit c6307e4

Browse files
committed
初始化
1 parent cc01fe3 commit c6307e4

File tree

168 files changed

+7379
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7379
-0
lines changed

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.1"
6+
defaultConfig {
7+
applicationId "ecnu.uleda"
8+
minSdkVersion 15
9+
targetSdkVersion 24
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(include: ['*.jar'], dir: 'libs')
24+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25+
exclude group: 'com.android.support', module: 'support-annotations'
26+
})
27+
compile files('libs/TencentMapSDK_Raster_v1.2.4_4af1d6f.jar')
28+
compile 'com.android.support:appcompat-v7:24.2.1'
29+
compile 'com.android.support:support-v4:24.2.1'
30+
compile 'com.android.support:design:24.2.1'
31+
compile'com.android.support:percent:24.2.1'
32+
compile'de.hdodenhof:circleimageview:2.1.0'
33+
compile'com.android.support:recyclerview-v7:24.2.1'
34+
testCompile 'junit:junit:4.12'
35+
}
Binary file not shown.

app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\Users\Shensheng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package ecnu.uleda;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("ecnu.uleda", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="ecnu.uleda">
4+
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
8+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
9+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
11+
12+
<application
13+
android:allowBackup="true"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name"
16+
android:largeHeap="true"
17+
android:supportsRtl="true"
18+
android:theme="@style/UMainTheme">
19+
<meta-data
20+
android:name="TencentMapSDK"
21+
android:value="DYXBZ-ALP33-ZZV3L-3LKO5-PLDRF-AKFEO" />
22+
23+
<activity
24+
android:name=".UMainActivity"
25+
android:screenOrientation="portrait" />
26+
<activity
27+
android:name=".LoginActivity"
28+
android:screenOrientation="portrait" />
29+
<activity
30+
android:name=".WelcomeActivity"
31+
android:screenOrientation="portrait"
32+
android:theme="@style/WelcomeTheme">
33+
<intent-filter>
34+
<action android:name="android.intent.action.MAIN" />
35+
36+
<category android:name="android.intent.category.LAUNCHER" />
37+
</intent-filter>
38+
</activity>
39+
<activity
40+
android:name=".TaskDetailsActivity"
41+
android:screenOrientation="portrait" />
42+
<activity android:name=".SettingActivity" />
43+
<activity android:name=".SingleUserInfoActivity" />
44+
<activity android:name=".SettingUserActivity" />
45+
<activity android:name=".SettingGeneralActivity" />
46+
<activity android:name=".SettingFeedbackActivity" />
47+
<activity android:name=".SettingAboutActivity" />
48+
<activity android:name=".MyWalletActivity" />
49+
<activity android:name=".MyQrActivity" />
50+
<activity android:name=".SettingUserPhoneActivity" />
51+
<activity android:name=".bottom_dialog" />
52+
<activity android:name=".Mywallet_RechargeActivity" />
53+
<activity android:name=".PopupwindowActivity"></activity>
54+
</application>
55+
56+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package ecnu.uleda;
2+
3+
/**
4+
* Created by TonyDanid on 2017/2/9.
5+
*/
6+
7+
public class AddOptions {
8+
private String mName;
9+
private int mImageId;
10+
11+
public AddOptions(String name,int imageid){
12+
this.mName=name;
13+
this.mImageId=imageid;
14+
}
15+
16+
public int getmImageId() {
17+
return mImageId;
18+
}
19+
20+
21+
public String getmName() {
22+
return mName;
23+
}
24+
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package ecnu.uleda;
2+
3+
import android.content.Intent;
4+
import android.content.res.ObbInfo;
5+
import android.os.Build;
6+
import android.os.Bundle;
7+
import android.os.Handler;
8+
import android.os.Message;
9+
import android.support.v7.app.AppCompatActivity;
10+
import android.util.Log;
11+
import android.view.View;
12+
import android.view.WindowManager;
13+
import android.widget.Button;
14+
import android.widget.EditText;
15+
import android.widget.Toast;
16+
17+
/**
18+
* Created by Shensheng on 2016/10/17.
19+
*/
20+
21+
public class LoginActivity extends AppCompatActivity {
22+
23+
private Button mLogin;
24+
private EditText mUserName;
25+
private EditText mPassword;
26+
private UserLoginController mUserLoginController;
27+
private Handler mLoginHandler=new Handler(){
28+
@Override
29+
public void handleMessage(Message msg){
30+
switch (msg.what){
31+
default:
32+
case UserLoginController.NOT_LOGIN:
33+
case UserLoginController.UNKNOWN_WRONG:
34+
Toast.makeText(LoginActivity.this,"登陆失败!未知错误",Toast.LENGTH_SHORT).show();
35+
setAllEnabled(true);
36+
break;
37+
case UserLoginController.SUCCESS_LOGIN: {
38+
Toast.makeText(LoginActivity.this, "登陆成功!", Toast.LENGTH_SHORT).show();
39+
Intent i=new Intent();
40+
i.putExtra("login","success");
41+
setResult(RESULT_OK,i);
42+
finish();
43+
break;
44+
}
45+
case UserLoginController.INTERNET_ERROR:
46+
Toast.makeText(LoginActivity.this,"登录失败!网络连接异常",Toast.LENGTH_SHORT).show();
47+
setAllEnabled(true);
48+
break;
49+
case UserLoginController.WRONG_PASSWORD_OR_USERNAME:
50+
Toast.makeText(LoginActivity.this,"登陆失败!用户名或密码错误",Toast.LENGTH_SHORT).show();
51+
setAllEnabled(true);
52+
break;
53+
}
54+
super.handleMessage(msg);
55+
}
56+
};
57+
@Override
58+
protected void onCreate(Bundle savedInstanceState){
59+
super.onCreate(savedInstanceState);
60+
setContentView(R.layout.activity_login);
61+
init();
62+
63+
UStatusBarUtils.setWindowStatusBarColor(LoginActivity.this,R.color.colorUMain);
64+
65+
//if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
66+
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);}
67+
}
68+
69+
70+
protected void init(){
71+
mLogin=(Button)findViewById(R.id.login_button);
72+
mUserName=(EditText)findViewById(R.id.user_name);
73+
mPassword=(EditText)findViewById(R.id.password);
74+
mLogin.setOnClickListener(new View.OnClickListener() {
75+
@Override
76+
public void onClick(View view) {
77+
if(mUserName.length()==0 || mPassword.length()<8){
78+
Toast.makeText(LoginActivity.this,"请输入合法的用户名/密码!",Toast.LENGTH_SHORT).show();
79+
return;
80+
}
81+
setAllEnabled(false);
82+
mUserLoginController=UserLoginController.getInstance(mUserName.getText().toString(),mPassword.getText().toString());
83+
//mUserLoginController=new UserLoginController(mUserName.getText().toString(),mPassword.getText().toString());
84+
Thread loginThread=new Thread(){
85+
@Override
86+
public void run(){
87+
mUserLoginController.login();
88+
Message msg=new Message();
89+
msg.what=mUserLoginController.getSuccessNumber();
90+
mLoginHandler.sendMessage(msg);
91+
}
92+
};
93+
loginThread.start();
94+
}
95+
});
96+
}
97+
98+
private void setAllEnabled(boolean a){
99+
mUserName.setEnabled(a);
100+
mPassword.setEnabled(a);
101+
mLogin.setEnabled(a);
102+
}
103+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package ecnu.uleda;
2+
3+
import android.app.Activity;
4+
import android.graphics.PorterDuff;
5+
import android.os.Bundle;
6+
import android.support.v4.app.Fragment;
7+
import android.util.Log;
8+
import android.view.LayoutInflater;
9+
import android.view.View;
10+
import android.view.ViewGroup;
11+
import android.widget.ArrayAdapter;
12+
import android.widget.ListView;
13+
import android.widget.Spinner;
14+
15+
import org.json.JSONObject;
16+
17+
import java.util.ArrayList;
18+
import java.util.Date;
19+
import java.util.List;
20+
21+
/**
22+
* Created by Shensheng on 2016/11/11.
23+
*/
24+
25+
public class MessageFragment extends Fragment {
26+
27+
private List<UMessage> MessageList ;
28+
private MessageListAdapter adapter;
29+
private ListView MessageListview;
30+
31+
@Override
32+
public void onCreate(Bundle b){
33+
super.onCreate(b);
34+
}
35+
36+
@Override
37+
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
38+
MessageList=createUser();//初始化消息列表
39+
adapter=new MessageListAdapter(this.getActivity().getApplicationContext()
40+
,R.layout.message_list_item,MessageList);
41+
View view=inflater.inflate(R.layout.message_fragment,container,false);
42+
MessageListview=(ListView)view.findViewById(R.id.message_list_view);
43+
MessageListview.setAdapter(adapter);
44+
return view;
45+
}
46+
47+
private List<UMessage>createUser(){
48+
List<UMessage> MList= new ArrayList<>();
49+
50+
UMessage m1=new UMessage("您的跑腿任务已完成",R.drawable.user2,
51+
"刚刚","点击对对方进行评价",R.drawable.white);
52+
MList.add(m1);
53+
UMessage m2=new UMessage("社区消息",R.drawable.user3,"昨天","[管理员@了你]",
54+
R.drawable.white);
55+
MList.add(m2);
56+
UMessage m3=new UMessage("致幻Trance",R.drawable.user1,"刚刚","在吗?",
57+
R.drawable.oneo);
58+
MList.add(m3);
59+
UMessage m4=new UMessage("赵铁柱",R.drawable.user4,"星期三",
60+
"我没看到 我不是和你们一起去的吗", R.drawable.white);
61+
MList.add(m4);
62+
UMessage m5=new UMessage("恭喜你发现一枚美少女",R.drawable.user5,"08-21","好吧",
63+
R.drawable.white);
64+
MList.add(m5);
65+
66+
67+
68+
return MList;
69+
70+
}
71+
72+
73+
}
74+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package ecnu.uleda;
2+
3+
import android.content.Context;
4+
import android.view.LayoutInflater;
5+
import android.view.View;
6+
import android.view.ViewGroup;
7+
import android.widget.ArrayAdapter;
8+
import android.widget.ImageView;
9+
import android.widget.TextView;
10+
import java.util.List;
11+
12+
13+
/**
14+
* Created by TonyDanid on 2017/1/20.
15+
*/
16+
17+
public class MessageListAdapter extends ArrayAdapter<UMessage> {
18+
19+
private int resourceId1;
20+
21+
public MessageListAdapter(Context context, int textViewResourceId,
22+
List<UMessage> objects) {
23+
super(context, textViewResourceId, objects);
24+
resourceId1 = textViewResourceId;
25+
}
26+
27+
@Override
28+
public View getView ( int position, View convertView, ViewGroup parent) {
29+
UMessage umessage = getItem(position);
30+
View view;
31+
if(convertView==null){
32+
view=LayoutInflater.from(getContext()).inflate(resourceId1,null);
33+
}else{
34+
view=convertView;
35+
}
36+
ImageView userimage=(ImageView)view.findViewById(R.id.userImage);
37+
TextView username=(TextView)view.findViewById(R.id.userName);
38+
TextView time=(TextView)view.findViewById(R.id.time);
39+
TextView message=(TextView)view.findViewById(R.id.message);
40+
ImageView hint=(ImageView)view.findViewById(R.id.hint);
41+
42+
userimage.setImageResource(umessage.getImageId());
43+
username.setText(umessage.getName());
44+
time.setText(umessage.getTime());
45+
message.setText(umessage.getMessage());
46+
hint.setImageResource(umessage.getHint());
47+
48+
return view;
49+
50+
51+
}
52+
}

0 commit comments

Comments
 (0)