@@ -1,19 +1,23 @@
package com.example.invisible.Activity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;

import com.example.invisible.Adapter.ChatListviewAdapter;
import com.example.invisible.Adapter.ChatRecyclerViewAdapter;
import com.example.invisible.Bean.Basebean;
import com.example.invisible.Bean.Message;
import com.example.invisible.Confi.BaseActivity;
import com.example.invisible.Factory.RetrofitFactory;
import com.example.invisible.R;
import com.hyphenate.EMMessageListener;
import com.hyphenate.chat.EMClient;
@@ -22,13 +26,20 @@
import java.util.ArrayList;
import java.util.List;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

public class ChatActivity extends BaseActivity implements View.OnClickListener {

private List<com.example.invisible.Bean.Message> messageList;

private View mStatusBarView;

private Toolbar mToolbar;
// private RecyclerView mChatRecyclerView;
// private RecyclerView mChatRecyclerView;
private ListView mListView;

private EditText mContentEdit;
/**
* 发送
@@ -39,17 +50,57 @@ public class ChatActivity extends BaseActivity implements View.OnClickListener {

private static final String TAG = "ChatActivity";

// private ChatRecyclerViewAdapter adapter;
// private ChatRecyclerViewAdapter adapter;

private ChatListviewAdapter adapter;

private String user_phone;

private String user_name;

private String role;

private boolean isLeave;

private boolean isNeedEva;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
fullScreen(this);
messageList = new ArrayList<>();
isLeave = false;
isNeedEva = false;
Intent i = getIntent();
user_phone = i.getStringExtra("other_mobile");
user_name = i.getStringExtra("name");
role = i.getStringExtra("role");
switch (role) {
case "chat": {
role = "匿名聊天";
isNeedEva = false;
break;
}
case "teller": {
role = "倾诉者";
isNeedEva = true;
break;
}
case "listener": {
role = "聆听者";
isNeedEva = true;
break;
}
default:
break;
}
initView();
Log.e(TAG, "onCreate: 2");
initEM();
}

private void initEM() {
msgListener = new EMMessageListener() {
@Override
public void onMessageReceived(List<EMMessage> messages) {
@@ -59,13 +110,31 @@ public void onMessageReceived(List<EMMessage> messages) {
Log.e(TAG, "onMessageReceived: " + message.toString());
Message msg = new Message();
String content = message.getBody().toString();
content.substring(4, content.length() - 1);
msg.setContent(content);
msg.setLayout_flag(0);
msg.setTime(message.localTime() + "");
Log.e(TAG, "onMessageReceived: severTime" + message.getMsgTime());
Log.e(TAG, "onMessageReceived: localTime" + message.localTime());
messageList.add(msg);
content = content.substring(5, content.length() - 1);
if (content.equals("///thekeyofexit///")) {
Log.e(TAG, "onMessageReceived: 出现");
isLeave = true;
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(ChatActivity.this, "对方已离开聊天", Toast.LENGTH_SHORT).show();
}
});
if (isNeedEva) {
Log.e(TAG, "onMessageReceived: showdialog");
showEvaluteDialog();
} else {
Log.e(TAG, "onMessageReceived: finish");
finish();
}
} else {
msg.setContent(content);
msg.setLayout_flag(0);
msg.setTime(message.localTime() + "");
Log.e(TAG, "onMessageReceived: severTime" + message.getMsgTime());
Log.e(TAG, "onMessageReceived: localTime" + message.localTime());
messageList.add(msg);
}
}
runOnUiThread(new Runnable() {
@Override
@@ -108,17 +177,97 @@ private void initView() {
mStatusBarView = (View) findViewById(R.id.statusBarView);
setUpStatusBar(mStatusBarView, "#242C3B");
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setUpToolbar(mToolbar, "", true);
setUpToolbar(mToolbar, role, true);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isNeedEva) {
showEvaluteDialog();
} else {
tellOtherLeave();
finish();
}
}
});
// setUpRecycler();
mListView = findViewById(R.id.chat_listView);
adapter = new ChatListviewAdapter(this, R.layout.layout_chat_recyclerview_item, messageList);
adapter = new ChatListviewAdapter(this, R.layout.layout_chat_recyclerview_item, messageList);
mListView.setAdapter(adapter);
mContentEdit = (EditText) findViewById(R.id.content_edit);
mSend = (Button) findViewById(R.id.send);
mSend.setOnClickListener(this);
}

// private void setUpRecycler() {
private void showEvaluteDialog() {
runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog.Builder dialog = new AlertDialog.Builder(ChatActivity.this)
.setTitle("Invisible")
.setMessage("离开前给您的聊天对象一个评价吧!")
.setCancelable(false)
.setPositiveButton("好评", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
exit(dialog, "1");
}
})
.setNegativeButton("差评", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
exit(dialog, "0");
}
});
dialog.show();
}
});
}

private void exit(DialogInterface dialog, String add) {
dialog.dismiss();
tellOtherLeave();
evalute(add);
finish();
}

private void tellOtherLeave() {
if (!isLeave) {
Log.e(TAG, "exit: send");
sendMessage("///thekeyofexit///");
}
}

private void evalute(String add) {
RetrofitFactory.getInstance().evalute("Token " + getS("token"), add, user_name)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Basebean>() {
@Override
public void accept(Basebean basebean) throws Exception {
if (basebean.getStatus() == 1) {
T("已收到您的评价");
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Log.e(TAG, "accept: evalute error" + throwable.getMessage());
}
});
}

@Override
public void onBackPressed() {
super.onBackPressed();
if (isNeedEva) {
showEvaluteDialog();
} else {
tellOtherLeave();
finish();
}
}

// private void setUpRecycler() {
// mChatRecyclerView = (RecyclerView) findViewById(R.id.chat_recyclerView);
// adapter = new ChatRecyclerViewAdapter(ChatActivity.this, messageList);
// adapter.setHasStableIds(true);
@@ -133,32 +282,32 @@ public void onClick(View v) {
default:
break;
case R.id.send:
String user;
if (getS("user").equals("17711356411")) {
Log.e(TAG, "onClick: to 13888888888");
user = "13888888888";
if (TextUtils.isEmpty(mContentEdit.getText().toString())) {
T("输入不能为空...");
} else {
Log.e(TAG, "onClick: to 17711356411");
user = "17711356411";
sendMessage(mContentEdit.getText().toString());
Message msg = new Message();
msg.setContent(mContentEdit.getText().toString());
msg.setLayout_flag(1);
msg.setTime("time");
messageList.add(msg);
Log.e(TAG, "onClick: " + messageList.size());
refreshListView();
mContentEdit.setText("");
}
//创建一条文本消息,content为消息文字内容,toChatUsername为对方用户或者群聊的id,后文皆是如此
EMMessage message = EMMessage.createTxtSendMessage(mContentEdit.getText().toString(), user);
break;
}
}

private void sendMessage(String msg) {
//创建一条文本消息,content为消息文字内容,toChatUsername为对方用户或者群聊的id,后文皆是如此
EMMessage message = EMMessage.createTxtSendMessage(msg, user_phone);
//如果是群聊,设置chattype,默认是单聊
// if (chatType == CHATTYPE_GROUP)
// message.setChatType(ChatType.GroupChat);
//发送消息
Log.e(TAG, "onClick: send");
EMClient.getInstance().chatManager().sendMessage(message);
Message msg = new Message();
msg.setContent(mContentEdit.getText().toString());
msg.setLayout_flag(1);
msg.setTime("time");
messageList.add(msg);
Log.e(TAG, "onClick: " + messageList.size());
refreshListView();
mContentEdit.setText("");
break;
}
Log.e(TAG, "onClick: send");
EMClient.getInstance().chatManager().sendMessage(message);
}

private void refreshListView() {
@@ -9,6 +9,7 @@
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
@@ -25,8 +26,8 @@
import com.example.invisible.Bean.Trace;
import com.example.invisible.Confi.BaseActivity;
import com.example.invisible.Factory.RetrofitFactory;
import com.example.invisible.FlowViewVertical;
import com.example.invisible.R;
import com.example.invisible.UI.FlowViewVertical;

import java.io.IOException;
import java.util.ArrayList;
@@ -79,6 +80,7 @@ protected void onCreate(Bundle savedInstanceState) {
date = "" + year + convertInt(month) + convertInt(day);//20180920
initView();
getTrace(token, date);

}

private void getTrace(String token, String date) {
@@ -168,15 +170,19 @@ public void afterTextChanged(Editable s) {
public void onClick(DialogInterface dialog, int which) {
String type = "日迹";
String content = editText.getText().toString();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
//time 201809201559 具体到分钟
String time = convertInt(year) + convertInt(month) + convertInt(day) + convertInt(hour) + convertInt(minute);
Log.e(TAG, "onClick: 上传的time为" + time);
putTrace(time, content, type, token);
if (TextUtils.isEmpty(content)) {
T("内容不能为空...");
} else {
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
//time 201809201559 具体到分钟
String time = convertInt(year) + convertInt(month) + convertInt(day) + convertInt(hour) + convertInt(minute);
Log.e(TAG, "onClick: 上传的time为" + time);
putTrace(time, content, type, token);
}
}
})
.setNegativeButton("取消", null)
@@ -48,6 +48,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
private TextView mForgetPassword;

private String phone;

private String password;

final static private int PHONE_REGISTER = 0;
@@ -102,6 +103,7 @@ public void onClick(View v) {
String pattern = "[0-9]*";
if (Pattern.matches(pattern, account) && account.length() == 11) {
if (!TextUtils.isEmpty(password)) {
//startActivity(new Intent(LoginActivity.this,SetPatternLockActivity.class));
login();
putS("user", account);
} else T("密码为空");
@@ -136,8 +138,9 @@ public void onSubscribe(Disposable d) {
public void onNext(Basebean<Token> tokenBasebean) {
if (tokenBasebean.getStatus() == 1) {
putS("token", tokenBasebean.getBody().getToken());
putS("name", tokenBasebean.getBody().getName());
Log.e(TAG, "accept: token" + tokenBasebean.getBody().getToken());
EMClient.getInstance().login(mAccount.getText().toString(),mPassword.getText().toString(),new EMCallBack() {//回调
EMClient.getInstance().login(mAccount.getText().toString(), mPassword.getText().toString(), new EMCallBack() {//回调
@Override
public void onSuccess() {
EMClient.getInstance().groupManager().loadAllGroups();
@@ -0,0 +1,58 @@
package com.example.invisible.Activity;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.widget.TextView;

import com.andrognito.patternlockview.PatternLockView;
import com.andrognito.patternlockview.listener.PatternLockViewListener;
import com.andrognito.patternlockview.utils.PatternLockUtils;
import com.example.invisible.Confi.BaseActivity;
import com.example.invisible.R;

import java.util.List;

public class SetPatternLockActivity extends BaseActivity {

private TextView mAttention;

private Toolbar mToolbar;

private PatternLockView mPatternLockView;

private PatternLockViewListener mListener = new PatternLockViewListener() {
@Override
public void onStarted() {
Log.d(getClass().getName(), "Pattern drawing started");
}

@Override
public void onProgress(List<PatternLockView.Dot> progressPattern) {
Log.d(getClass().getName(), "Pattern progress: " +
PatternLockUtils.patternToString(mPatternLockView, progressPattern));
}

@Override
public void onComplete(List<PatternLockView.Dot> pattern) {
Log.d(getClass().getName(), "Pattern complete: " +
PatternLockUtils.patternToString(mPatternLockView, pattern));
}

@Override
public void onCleared() {
Log.d(getClass().getName(), "Pattern has been cleared");
}
};

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_pattern_lock);
mPatternLockView = findViewById(R.id.pattern_lock_view);
mPatternLockView.addPatternLockListener(mListener);
mToolbar = findViewById(R.id.toolbar);
setUpToolbar(mToolbar, "手势", true);
mAttention = findViewById(R.id.attention);
}
}
@@ -0,0 +1,23 @@
package com.example.invisible.Bean;

public class AnotherPhone {
private String anothermobile;

private String name;

public String getAnothermobile() {
return anothermobile;
}

public void setAnothermobile(String anothermobile) {
this.anothermobile = anothermobile;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
@@ -0,0 +1,13 @@
package com.example.invisible.Bean;

public class Score {
String score;

public String getScore() {
return score;
}

public void setScore(String score) {
this.score = score;
}
}
@@ -7,6 +7,16 @@ public class Token {

private String token;

private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getToken() {
return token;
}
@@ -43,6 +43,8 @@ public void setUpToolbar(Toolbar mToolbar,String title,boolean isBack) {
}
}



public void setUpStatusBar(View view,String color) {
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
layoutParams.height = getStatusBarHeight();
@@ -0,0 +1,109 @@
package com.example.invisible.Confi;

import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;

import com.example.invisible.Activity.ChatActivity;
import com.example.invisible.Bean.AnotherPhone;
import com.example.invisible.Bean.Basebean;
import com.example.invisible.Factory.RetrofitFactory;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

public class BaseFragment extends android.support.v4.app.Fragment {

private static final String TAG = "BaseFragment";
private ProgressDialog progressDialog;

//获取SharedPreferences对象
public SharedPreferences getPreference() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
return preferences;
}

//获取缓存
public String getS(String key) {
return getPreference().getString(key, null);
}


public void match(final String role) {
showProgressDialog();
RetrofitFactory.getInstance().match("Token " + getS("token"), role)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<Basebean<AnotherPhone>>() {
@Override
public void accept(Basebean<AnotherPhone> basebean) throws Exception {
Log.e(TAG, "accept: accept" + basebean.getMsg());
Log.e(TAG, "accept: accept" + basebean.getStatus());
if (basebean.getStatus() == 1) {
Intent i = new Intent(getActivity(), ChatActivity.class);
i.putExtra("other_mobile", basebean.getBody().getAnothermobile());
i.putExtra("name", basebean.getBody().getName());
i.putExtra("role", role);
startActivity(i);
} else {
Toast.makeText(getActivity(), "匹配失败", Toast.LENGTH_SHORT).show();
}
progressDialogDismiss();
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Toast.makeText(getActivity(), "匹配失败", Toast.LENGTH_SHORT).show();
progressDialogDismiss();
Log.e(TAG, "accept: error error" + throwable.getMessage());
}
});
}

private void progressDialogDismiss() {
if (progressDialog.isShowing()) {
progressDialog.dismiss();
}
}

private void showProgressDialog() {
if (progressDialog == null) {
progressDialog = new ProgressDialog(getActivity());
}
progressDialog.setMessage("匹配ing...");
progressDialog.setTitle("请稍等");
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
progressDialog.setMessage("取消中...");
//TODO progressDialog dismiss
break_match();
progressDialogDismiss();
}
});
progressDialog.show();
}

private void break_match() {
RetrofitFactory.getInstance().break_match("Token " + getS("token"))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Basebean>() {
@Override
public void accept(Basebean basebean) throws Exception {
Log.e(TAG, "accept: break_match" + basebean.getMsg());
//TODO depend on msg
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
Log.e(TAG, "accept: break_match" + throwable.getMessage());
}
});
}
}
@@ -12,12 +12,13 @@
import android.widget.Button;

import com.example.invisible.Activity.ChatActivity;
import com.example.invisible.Confi.BaseFragment;
import com.example.invisible.R;

/**
* A simple {@link Fragment} subclass.
*/
public class ChatFragment extends Fragment implements View.OnClickListener {
public class ChatFragment extends BaseFragment implements View.OnClickListener {

private static final String TAG = "ChatFragment";
private Button mChat;
@@ -42,14 +43,15 @@ private void initView(View view) {
mChat.setOnClickListener(this);
}


@Override
public void onClick(View v) {
switch (v.getId()) {
default:
break;
case R.id.chat:
Log.e(TAG, "onClick: 1" );
startActivity(new Intent(getActivity(), ChatActivity.class));
Log.e(TAG, "onClick: 1");
match("chat");
break;
}
}
@@ -6,15 +6,19 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.invisible.Confi.BaseFragment;
import com.example.invisible.R;

/**
* A simple {@link Fragment} subclass.
*/
public class ListenFragment extends Fragment {
public class ListenFragment extends BaseFragment {


private Button mListen;

public ListenFragment() {
// Required empty public constructor
}
@@ -24,7 +28,15 @@ public ListenFragment() {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_listen, container, false);
View view = inflater.inflate(R.layout.fragment_listen, container, false);
mListen = view.findViewById(R.id.listen);
mListen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
match("listener");
}
});
return view;
}

}
@@ -1,19 +1,24 @@
package com.example.invisible.Fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.invisible.Activity.ChatActivity;
import com.example.invisible.Confi.BaseFragment;
import com.example.invisible.R;

/**
* A simple {@link Fragment} subclass.
*/
public class TalkFragment extends Fragment {
public class TalkFragment extends BaseFragment implements View.OnClickListener {

private Button mTalk;

public TalkFragment() {
// Required empty public constructor
@@ -24,7 +29,23 @@ public TalkFragment() {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_talk, container, false);
View view = inflater.inflate(R.layout.fragment_talk, null);
initView(view);
return view;
}

private void initView(View view) {
mTalk = view.findViewById(R.id.talk);
mTalk.setOnClickListener(this);
}


@Override
public void onClick(View v) {
switch (v.getId())
{
case R.id.talk:
match("teller");
}
}
}
@@ -1,8 +1,10 @@
package com.example.invisible.Service;

import com.example.invisible.Bean.AnotherPhone;
import com.example.invisible.Bean.Basebean;
import com.example.invisible.Bean.Bottle;
import com.example.invisible.Bean.HistoryBottles;
import com.example.invisible.Bean.Score;
import com.example.invisible.Bean.Token;
import com.example.invisible.Bean.Trace;

@@ -54,27 +56,32 @@ Observable<Basebean> testMessage(@Field("mobile") String mobile,
Observable<Basebean> modifyPassword(@Field("mobile") String mobile,
@Field("password") String password);

//获取日迹
@FormUrlEncoded
@POST("api/get_trace/")
Observable<Basebean<List<Trace>>> getTrace(@Field("time") String time,
@Header("Authorization") String token);

//上传日迹
@FormUrlEncoded
@POST("api/trace/")
Observable<Basebean> putTrace(@Field("time") String time,
@Field("content") String content,
@Field("type") String type,
@Header("Authorization") String token);

//获取一个漂流瓶
@GET("api/bottle/")
Observable<Basebean<Bottle>> getBottle(@Header("Authorization") String token);

//丢一个漂流瓶
@FormUrlEncoded
@POST("api/bottle/")
Observable<Basebean> sendBottle(@Header("Authorization") String token,
@Field("content") String content,
@Field("date") String date);

//回复漂流瓶
@FormUrlEncoded
@POST("api/re_bottle/")
Observable<Basebean> replyBottle(@Header("Authorization") String token,
@@ -83,6 +90,29 @@ Observable<Basebean> replyBottle(@Header("Authorization") String token,
@Field("to_user") String userId,
@Field("date") String anything);

//获取被回复的漂流瓶
@GET("api/get_rebottle/")
Observable<Basebean<List<HistoryBottles.HistoryItem>>> getHistoryBottle(@Header("Authorization") String token);

//聊天匹配
@FormUrlEncoded
@POST("api/match/")
Observable<Basebean<AnotherPhone>> match(@Header("Authorization") String token,
@Field("role") String role);

//取消匹配
@POST("api/break_match/")
Observable<Basebean> break_match(@Header("Authorization") String token);

//评价
@FormUrlEncoded
@POST("api/evalute/")
Observable<Basebean> evalute(@Header("Authorization") String token,
@Field("add") String add,
@Field("user") String username);

//获取好感度
@GET("api/get_score/")
Observable<Basebean<Score>> get_score(@Header("Authorization") String token);

}
@@ -1,4 +1,4 @@
package com.example.invisible;
package com.example.invisible.UI;

import android.content.Context;
import android.content.res.TypedArray;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--宽度-->
<size android:width="1dp" />
<!--色值-->
<solid android:color="@color/color_gray"/>
</shape>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--宽度-->
<size android:width="1dp" />
<!--色值-->
<solid android:color="@color/color_white"/>
</shape>
@@ -2,5 +2,5 @@
<!--Login按钮点击背景改变-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_not_pressed" android:state_pressed="false"></item> <!-- 未点击时的颜色 -->
<item android:drawable="@drawable/button_pressed" android:state_pressed="true"></item> <!-- 点击后的颜色 -->
<item android:drawable="@drawable/button_not_pressed" android:state_pressed="true"></item> <!-- 点击后的颜色 -->
</selector>
@@ -4,8 +4,8 @@
android:shape="rectangle">
<stroke
android:width="2dp"
android:color="@color/colorAccent" />
android:color="#FF19C587" />
<solid
android:color="@color/colorAccent" />
<corners android:radius="3dp" />
android:color="#FF19C587" />
<corners android:radius="5dp" />
</shape>
@@ -76,6 +76,7 @@
</LinearLayout>

<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content">

@@ -1,148 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start">
android:orientation="vertical"
tools:context=".Activity.CenterActivity">

<View
android:id="@+id/statusBarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transport" />

<!--theme: change toolbar icon color-->
<!--popupTheme: change toolbar appear location-->
<LinearLayout
android:id="@+id/content_layout"
android:id="@+id/center_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Activity.CenterActivity">
android:layout_height="wrap_content"
android:background="#242C3B"
android:orientation="vertical">

<View
android:id="@+id/statusBarView"
android:background="@color/transport"
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
app:popupTheme="@style/ToolbarPopupTheme"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleMarginStart="93dp"
app:titleTextColor="@color/color_white" />

<!--theme: change toolbar icon color-->
<!--popupTheme: change toolbar appear location-->
<LinearLayout
android:id="@+id/center_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#242C3B"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:navigationIcon="@drawable/icons8_menu_36"
app:popupTheme="@style/ToolbarPopupTheme"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleMarginStart="93dp"
app:titleTextColor="@color/color_white" />
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal">

<ImageView
android:id="@+id/head_pic"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="20dp"
android:src="@color/color_red" />

<LinearLayout
android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">

<ImageView
android:id="@+id/head_pic"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="20dp"
android:src="@color/color_red" />
<TextView
android:id="@+id/nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_white"
android:textSize="16sp" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="horizontal">

<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/heart" />

<TextView
android:textSize="16sp"
android:id="@+id/nickname"
android:id="@+id/user_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_white"
android:text="一个小可爱的测试id" />

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:src="@drawable/heart"
android:layout_width="25dp"
android:layout_height="25dp" />
<TextView
android:textSize="16sp"
android:id="@+id/user_num"
android:textColor="@color/color_white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="99" />
</LinearLayout>
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_marginTop="20dp"
android:layout_marginBottom="15dp"
android:layout_width="match_parent"
android:layout_height="35dp"
android:orientation="horizontal">

<TextView
android:id="@+id/talk"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="倾诉"
android:textColor="@color/color_white"
android:textSize="20sp" />

<TextView
android:textSize="20sp"
android:id="@+id/chat"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="聊天"
android:textColor="@color/color_white" />

<TextView
android:id="@+id/listen"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="聆听"
android:textColor="@color/color_white"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_height="35dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="15dp"
android:orientation="horizontal">

<TextView
android:id="@+id/talk"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="倾诉"
android:textColor="@color/color_white"
android:textSize="20sp" />

<TextView
android:id="@+id/chat"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="聊天"
android:textColor="@color/color_white"
android:textSize="20sp" />

<TextView
android:id="@+id/listen"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="聆听"
android:textColor="@color/color_white"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>

<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>



<!--navigation view-->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header"
app:menu="@menu/nav_menu" />

</android.support.v4.widget.DrawerLayout>
@@ -25,7 +25,9 @@
app:popupTheme="@style/ToolbarPopupTheme"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleMarginStart="93dp"
app:titleTextColor="@color/color_white" />
app:titleTextColor="@color/color_white">

</android.support.v7.widget.Toolbar>

<!--<android.support.v7.widget.RecyclerView-->
<!--android:id="@+id/chat_recyclerView"-->
@@ -18,7 +18,7 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:contentScrim="@color/colorAccent"
app:contentScrim="@color/deep_blue"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<ImageView
@@ -61,7 +61,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.example.invisible.FlowViewVertical
<com.example.invisible.UI.FlowViewVertical
android:id="@+id/FlowViewVertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -3,17 +3,18 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/deep_blue"
android:orientation="vertical"
tools:context=".Activity.LoginActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_gravity="left"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:text="@string/app_name"
android:textColor="#000"
android:textColor="@color/white"
android:textSize="40sp" />

<TextView
@@ -23,36 +24,43 @@
android:layout_marginTop="60dp"
android:gravity="center"
android:text="账号"
android:textColor="#000"
android:textColor="@color/white"
android:textSize="14sp" />

<EditText
android:maxLength="11"
android:textSize="21sp"
android:id="@+id/account"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:hint="Phone Number"
android:inputType="phone" />
android:inputType="phone"
android:maxLength="11"
android:textColor="@color/white"
android:textColorHint="#F0EEEE"
android:textCursorDrawable="@drawable/bg_login_edittext"
android:textSize="21sp" />

<EditText
android:maxLength="16"
android:textSize="21sp"
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:hint="Password"
android:inputType="textPassword" />
android:inputType="textPassword"
android:maxLength="16"
android:textColor="@color/white"
android:textColorHint="#F0EEEE"
android:textCursorDrawable="@drawable/bg_login_edittext"
android:textSize="21sp" />

<include layout="@layout/layout_button"
android:layout_marginTop="60dp"
<include
layout="@layout/layout_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_marginTop="60dp" />

<LinearLayout
android:layout_width="match_parent"
@@ -69,7 +77,7 @@
android:gravity="left"
android:paddingLeft="40dp"
android:text="快速注册"
android:textColor="#000"
android:textColor="@color/white"
android:textSize="14sp" />

<TextView
@@ -81,7 +89,7 @@
android:gravity="right"
android:paddingRight="40dp"
android:text="忘记密码"
android:textColor="#000"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_gray"
android:orientation="vertical"
tools:context=".Activity.SetPatternLockActivity">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#22384C"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleMarginStart="93dp"
app:titleTextColor="@color/color_white" />


<com.andrognito.patternlockview.PatternLockView
android:layout_marginTop="100dp"
android:layout_gravity="center"
android:id="@+id/pattern_lock_view"
android:layout_width="280dp"
android:layout_height="280dp" />

<TextView
android:layout_gravity="center"
android:id="@+id/attention"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入密码"
android:textColor="@color/white" />

</LinearLayout>
@@ -13,6 +13,8 @@
android:gravity="center"
android:layout_marginTop="60dp"
android:id="@+id/account"
android:textCursorDrawable="@drawable/bg_edittext"
android:theme="@style/MyEditText"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="20dp"
@@ -39,7 +39,7 @@
android:textSize="40sp"
app:bottomLineHeight="2dp"
app:bottomLineNormalColor="@color/color_black"
app:bottomLineSelectedColor="@color/colorAccent"
app:bottomLineSelectedColor="@color/deep_blue"
app:figures="6"
app:selectedBackgroundColor="@color/transport"
app:verCodeMargin="10dp" />
@@ -27,6 +27,8 @@
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:hint="Nickname"
android:textCursorDrawable="@drawable/bg_edittext"
android:theme="@style/MyEditText"
android:inputType="text"
android:textSize="21sp" />

@@ -41,6 +43,8 @@
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:textCursorDrawable="@drawable/bg_edittext"
android:theme="@style/MyEditText"
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="60dp"
@@ -61,6 +65,8 @@
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:textCursorDrawable="@drawable/bg_edittext"
android:theme="@style/MyEditText"
android:maxLength="16"
android:id="@+id/password1"
android:layout_width="match_parent"
@@ -72,6 +78,8 @@
android:textSize="21sp" />

<EditText
android:textCursorDrawable="@drawable/bg_edittext"
android:theme="@style/MyEditText"
android:maxLength="16"
android:id="@+id/password2"
android:layout_width="match_parent"
@@ -88,4 +96,4 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp" />
</LinearLayout>
</LinearLayout>
@@ -1,15 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_3"
tools:context=".Fragment.TalkFragment">
android:orientation="vertical"
android:background="@drawable/background_1_modified"
tools:context=".Fragment.ChatFragment">

<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="talk" />
android:text="我有故事 你有酒吗"
android:layout_marginTop="100dp"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="40dp" />

</FrameLayout>
<Button
android:id="@+id/talk"
android:layout_marginTop="150dp"
android:layout_gravity="center_horizontal"
android:text="开始聊天"
android:textColor="@drawable/login_text_color"
android:background="@drawable/button_startchat"
android:layout_width="200dp"
android:layout_height="41dp" />
</LinearLayout>
@@ -9,7 +9,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:background="@drawable/button_login"
android:textColor="@drawable/login_text_color"
android:background="@drawable/button_not_pressed"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
@@ -8,7 +8,7 @@
app:titleTextColor="@color/color_white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:background="#FF242C3B"
app:navigationIcon="@drawable/ic_chevron_left_white_36dp"
app:titleMarginStart="93dp" />
</LinearLayout>
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/bottle"
android:icon="@drawable/icons8_sea_heart_36"
@@ -9,4 +8,12 @@
android:id="@+id/diary"
android:icon="@drawable/icons8_sign_up_36"
android:title="日迹" />
<item
android:id="@+id/delete_share_preference"
android:icon="@drawable/icons8_restart_36"
android:title="清除缓存" />
<item
android:id="@+id/exit"
android:icon="@drawable/ic_arrow_back_black_24dp"
android:title="退出登录" />
</menu>
@@ -12,6 +12,7 @@
<color name="gray">#8A000000</color>
<color name="FRAGMENT_ONE_COLOR">#242C3B</color>
<color name="uncompleted_text_color">#BBBBBB</color>
<color name="deep_blue">#FF242C3B</color>
<drawable name="color_black">#000</drawable>
<drawable name="color_white">#FFF</drawable>
<drawable name="color_gray">#9E9E9E</drawable>
@@ -3,8 +3,8 @@
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#3F51B5</item>
<item name="colorPrimaryDark">#CE2820</item>
<item name="colorAccent">#F23826</item>
<item name="colorPrimaryDark">#FF242C3B</item>
<item name="colorAccent">#3F51B5</item>
</style>

<style name="ToolbarPopupTheme" parent="ThemeOverlay.AppCompat.Light">
@@ -14,4 +14,15 @@
<style name="TransparentActivity" parent="AppTheme">

</style>

<!--colorControlNormal 为没有获取焦点时候下划线的颜色-->
<!--colorControlActivated 为获取焦点时候光标与下划线的颜色-->
<style name="MyEditText" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">@color/color_gray</item>
<item name="colorControlActivated">@color/color_gray</item>
</style>
<style name="LoginEditText" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">@color/color_white</item>
<item name="colorControlActivated">@color/color_white</item>
</style>
</resources>