Compare commits
13 Commits
branch_sui
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
d906ef5a76 | 5 years ago |
|
|
938fce821a | 5 years ago |
|
|
2581b9e5a2 | 5 years ago |
|
|
40727e4c12 | 5 years ago |
|
|
fcd29d2236 | 5 years ago |
|
|
f8fb62a062 | 5 years ago |
|
|
9a0c24395f | 5 years ago |
|
|
e37dd418ad | 5 years ago |
|
|
74aa2163d6 | 5 years ago |
|
|
bdb9b4dac2 | 5 years ago |
|
|
174324e830 | 5 years ago |
|
|
7f4e3b054e | 5 years ago |
|
|
bd47d08b61 | 5 years ago |
|
Before Width: | Height: | Size: 456 KiB |
@ -0,0 +1,127 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
public class CharacterParser {
|
||||
private static int[] pyvalue = new int[] {-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036, -20032,
|
||||
-20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741, -19739, -19728,
|
||||
-19725, -19715, -19540, -19531, -19525, -19515, -19500, -19484, -19479, -19467, -19289, -19288, -19281, -19275, -19270, -19263, -19261,
|
||||
-19249, -19243, -19242, -19238, -19235, -19227, -19224, -19218, -19212, -19038, -19023, -19018, -19006, -19003, -18996, -18977, -18961,
|
||||
-18952, -18783, -18774, -18773, -18763, -18756, -18741, -18735, -18731, -18722, -18710, -18697, -18696, -18526, -18518, -18501, -18490,
|
||||
-18478, -18463, -18448, -18447, -18446, -18239, -18237, -18231, -18220, -18211, -18201, -18184, -18183, -18181, -18012, -17997, -17988,
|
||||
-17970, -17964, -17961, -17950, -17947, -17931, -17928, -17922, -17759, -17752, -17733, -17730, -17721, -17703, -17701, -17697, -17692,
|
||||
-17683, -17676, -17496, -17487, -17482, -17468, -17454, -17433, -17427, -17417, -17202, -17185, -16983, -16970, -16942, -16915, -16733,
|
||||
-16708, -16706, -16689, -16664, -16657, -16647, -16474, -16470, -16465, -16459, -16452, -16448, -16433, -16429, -16427, -16423, -16419,
|
||||
-16412, -16407, -16403, -16401, -16393, -16220, -16216, -16212, -16205, -16202, -16187, -16180, -16171, -16169, -16158, -16155, -15959,
|
||||
-15958, -15944, -15933, -15920, -15915, -15903, -15889, -15878, -15707, -15701, -15681, -15667, -15661, -15659, -15652, -15640, -15631,
|
||||
-15625, -15454, -15448, -15436, -15435, -15419, -15416, -15408, -15394, -15385, -15377, -15375, -15369, -15363, -15362, -15183, -15180,
|
||||
-15165, -15158, -15153, -15150, -15149, -15144, -15143, -15141, -15140, -15139, -15128, -15121, -15119, -15117, -15110, -15109, -14941,
|
||||
-14937, -14933, -14930, -14929, -14928, -14926, -14922, -14921, -14914, -14908, -14902, -14894, -14889, -14882, -14873, -14871, -14857,
|
||||
-14678, -14674, -14670, -14668, -14663, -14654, -14645, -14630, -14594, -14429, -14407, -14399, -14384, -14379, -14368, -14355, -14353,
|
||||
-14345, -14170, -14159, -14151, -14149, -14145, -14140, -14137, -14135, -14125, -14123, -14122, -14112, -14109, -14099, -14097, -14094,
|
||||
-14092, -14090, -14087, -14083, -13917, -13914, -13910, -13907, -13906, -13905, -13896, -13894, -13878, -13870, -13859, -13847, -13831,
|
||||
-13658, -13611, -13601, -13406, -13404, -13400, -13398, -13395, -13391, -13387, -13383, -13367, -13359, -13356, -13343, -13340, -13329,
|
||||
-13326, -13318, -13147, -13138, -13120, -13107, -13096, -13095, -13091, -13076, -13068, -13063, -13060, -12888, -12875, -12871, -12860,
|
||||
-12858, -12852, -12849, -12838, -12831, -12829, -12812, -12802, -12607, -12597, -12594, -12585, -12556, -12359, -12346, -12320, -12300,
|
||||
-12120, -12099, -12089, -12074, -12067, -12058, -12039, -11867, -11861, -11847, -11831, -11798, -11781, -11604, -11589, -11536, -11358,
|
||||
-11340, -11339, -11324, -11303, -11097, -11077, -11067, -11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014,
|
||||
-10838, -10832, -10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328, -10322, -10315, -10309,
|
||||
-10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254};
|
||||
public static String[] pystr = new String[] {"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian",
|
||||
"biao", "bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "ceng", "cha", "chai", "chan", "chang", "chao", "che",
|
||||
"chen", "cheng", "chi", "chong", "chou", "chu", "chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci", "cong", "cou", "cu", "cuan",
|
||||
"cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du",
|
||||
"duan", "dui", "dun", "duo", "e", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang",
|
||||
"gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha", "hai", "han", "hang",
|
||||
"hao", "he", "hei", "hen", "heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang", "hui", "hun", "huo", "ji", "jia", "jian",
|
||||
"jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "ken",
|
||||
"keng", "kong", "kou", "ku", "kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng",
|
||||
"li", "lia", "lian", "liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "lv", "luan", "lue", "lun", "luo", "ma", "mai",
|
||||
"man", "mang", "mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na", "nai",
|
||||
"nan", "nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang", "niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan",
|
||||
"nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po", "pu",
|
||||
"qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re",
|
||||
"ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen", "seng", "sha",
|
||||
"shai", "shan", "shang", "shao", "she", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui", "shun",
|
||||
"shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng", "ti", "tian", "tiao",
|
||||
"tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen", "weng", "wo", "wu", "xi",
|
||||
"xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi",
|
||||
"yin", "ying", "yo", "yong", "you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha",
|
||||
"zhai", "zhan", "zhang", "zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui",
|
||||
"zhun", "zhuo", "zi", "zong", "zou", "zu", "zuan", "zui", "zun", "zuo"};
|
||||
private StringBuilder buffer;
|
||||
private String resource;
|
||||
private static CharacterParser characterParser = new CharacterParser();
|
||||
|
||||
public static CharacterParser getInstance() {
|
||||
return characterParser;
|
||||
}
|
||||
|
||||
public String getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
public void setResource(String resource) {
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
/** * 汉字转成ASCII码 * * @param chs * @return */
|
||||
private int getChsAscii(String chs) {
|
||||
int asc = 0;
|
||||
try {
|
||||
byte[] bytes = chs.getBytes("gb2312");
|
||||
if (bytes == null || bytes.length > 2 || bytes.length <= 0) {
|
||||
throw new RuntimeException("illegal resource string");
|
||||
}
|
||||
if (bytes.length == 1) {
|
||||
asc = bytes[0];
|
||||
}
|
||||
if (bytes.length == 2) {
|
||||
int hightByte = 256 + bytes[0];
|
||||
int lowByte = 256 + bytes[1];
|
||||
asc = (256 * hightByte + lowByte) - 256 * 256;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("ERROR:ChineseSpelling.class-getChsAscii(String chs)" + e);
|
||||
}
|
||||
return asc;
|
||||
}
|
||||
|
||||
/** * 单字解析 * * @param str * @return */
|
||||
public String convert(String str) {
|
||||
String result = null;
|
||||
int ascii = getChsAscii(str);
|
||||
if (ascii > 0 && ascii < 160) {
|
||||
result = String.valueOf((char) ascii);
|
||||
} else {
|
||||
for (int i = (pyvalue.length - 1); i >= 0; i--) {
|
||||
if (pyvalue[i] <= ascii) {
|
||||
result = pystr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** * 词组解析 * * @param chs * @return */
|
||||
public String getSelling(String chs) {
|
||||
String key, value;
|
||||
buffer = new StringBuilder();
|
||||
for (int i = 0; i < chs.length(); i++) {
|
||||
key = chs.substring(i, i + 1);
|
||||
if (key.getBytes().length >= 2) {
|
||||
value = (String) convert(key);
|
||||
if (value == null) {
|
||||
value = "unknown";
|
||||
}
|
||||
} else {
|
||||
value = key;
|
||||
}
|
||||
buffer.append(value);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public String getSpelling() {
|
||||
return this.getSelling(this.getResource());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
/**
|
||||
* 城市 与城市代码
|
||||
*/
|
||||
public class Country {
|
||||
private String country;
|
||||
private String countryCode;
|
||||
private String sortLetters; //显示数据拼音的首字母
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public String getCountryCode() {
|
||||
return countryCode;
|
||||
}
|
||||
|
||||
public void setCountryCode(String countryCode) {
|
||||
this.countryCode = countryCode;
|
||||
}
|
||||
|
||||
public String getSortLetters() {
|
||||
return sortLetters;
|
||||
}
|
||||
|
||||
public void setSortLetters(String sortLetters) {
|
||||
this.sortLetters = sortLetters;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.SectionIndexer;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.luyin.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CountryAdapter extends BaseAdapter implements SectionIndexer {
|
||||
private List<Country> list = null;
|
||||
private Context mContext;
|
||||
|
||||
public CountryAdapter(Context mContext, List<Country> list) {
|
||||
this.mContext = mContext;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当ListView数据发生变化时,调用此方法来更新ListView
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public void updateListView(List<Country> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return this.list.size();
|
||||
}
|
||||
|
||||
public Object getItem(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
public View getView(final int position, View view, ViewGroup arg2) {
|
||||
/**得到手机通讯录联系人信息**/
|
||||
ViewHolder viewHolder;
|
||||
Country mContent=list.get(position);
|
||||
if (view == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
view = LayoutInflater.from(mContext).inflate(R.layout.item_country, null);
|
||||
viewHolder.tvTitle = (TextView) view.findViewById(R.id.title);
|
||||
viewHolder.tvLetter = (TextView) view.findViewById(R.id.catalog);
|
||||
viewHolder.number = (TextView) view.findViewById(R.id.number);
|
||||
view.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) view.getTag();
|
||||
}
|
||||
|
||||
//根据position获取分类的首字母的Char ascii值
|
||||
int section = getSectionForPosition(position);
|
||||
|
||||
//如果当前位置等于该分类首字母的Char的位置 ,则认为是第一次出现
|
||||
if (position == getPositionForSection(section)) {
|
||||
viewHolder.tvLetter.setVisibility(View.VISIBLE);
|
||||
viewHolder.tvLetter.setText(mContent.getSortLetters());
|
||||
} else {
|
||||
viewHolder.tvLetter.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
viewHolder.tvTitle.setText(this.list.get(position).getCountry());
|
||||
viewHolder.number.setText(this.list.get(position).getCountryCode());
|
||||
|
||||
return view;
|
||||
|
||||
}
|
||||
|
||||
|
||||
final static class ViewHolder {
|
||||
TextView tvLetter;
|
||||
TextView tvTitle;
|
||||
TextView number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据ListView的当前位置获取分类的首字母的Char ascii值
|
||||
*/
|
||||
public int getSectionForPosition(int position) {
|
||||
return list.get(position).getSortLetters().charAt(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类的首字母的Char ascii值获取其第一次出现该首字母的位置
|
||||
*/
|
||||
public int getPositionForSection(int section) {
|
||||
for (int i = 0; i < getCount(); i++) {
|
||||
String sortStr = list.get(i).getSortLetters();
|
||||
char firstChar = sortStr.toUpperCase().charAt(0);
|
||||
if (firstChar == section) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getSections() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.luyin.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import cn.smssdk.SMSSDK;
|
||||
|
||||
/**
|
||||
* 国家代码
|
||||
* Created by donkor
|
||||
*/
|
||||
public class CountryCodeActivity extends Activity {
|
||||
|
||||
private SideBar sideBar;
|
||||
private TextView dialog;
|
||||
private ListView sortListView;
|
||||
private CountryAdapter countryAdapter;
|
||||
private Button btnBack;
|
||||
private ArrayList<Country> countryList;
|
||||
/**
|
||||
* 根据拼音来排列ListView里面的数据类
|
||||
*/
|
||||
private CountryPinyinComparator pinyinComparator;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.activity_country_code);
|
||||
|
||||
// SMSSDK.initSDK(this, "167cf953112d0", "538346cc0f97e65a042adfec13badc72");
|
||||
pinyinComparator = new CountryPinyinComparator();
|
||||
|
||||
sideBar = (SideBar) findViewById(R.id.sidrbar);
|
||||
dialog = (TextView) findViewById(R.id.dialog);
|
||||
sideBar.setTextView(dialog);
|
||||
sortListView = (ListView) findViewById(R.id.country_lvcountry);
|
||||
btnBack = (Button) findViewById(R.id.btnBack);
|
||||
|
||||
btnBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CountryCodeActivity.this.finish();
|
||||
}
|
||||
});
|
||||
|
||||
GetCountryList list = new GetCountryList();
|
||||
countryList = list.getCountry(SMSSDK.getGroupedCountryList());
|
||||
// Log.e("asd", "zone.size(): " + zone.size());
|
||||
// 根据a-z进行排序源数据
|
||||
Collections.sort(countryList, pinyinComparator);
|
||||
// adapter = new SortAdapter(getActivity(), SourceDateList);
|
||||
|
||||
countryAdapter = new CountryAdapter(CountryCodeActivity.this, countryList);
|
||||
sortListView.setAdapter(countryAdapter);
|
||||
|
||||
// 设置右侧触摸监听
|
||||
sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {
|
||||
|
||||
@Override
|
||||
public void onTouchingLetterChanged(String s) {
|
||||
//该字母首次出现的位置
|
||||
int position = countryAdapter.getPositionForSection(s.charAt(0));
|
||||
if (position != -1) {
|
||||
sortListView.setSelection(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sortListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
Intent mIntent = new Intent(CountryCodeActivity.this, MainActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
String country = countryList.get(position).getCountry();
|
||||
String countryCode = countryList.get(position).getCountryCode().replace("+","");
|
||||
b.putString("country", country);
|
||||
b.putString("countryCode", countryCode);
|
||||
mIntent.putExtras(b);
|
||||
CountryCodeActivity.this.setResult(1, mIntent);
|
||||
CountryCodeActivity.this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class CountryPinyinComparator implements Comparator<Country> {
|
||||
public int compare(Country o1, Country o2) {
|
||||
if (o1.getSortLetters().equals("@")
|
||||
|| o2.getSortLetters().equals("#")) {
|
||||
return -1;
|
||||
} else if (o1.getSortLetters().equals("#")
|
||||
|| o2.getSortLetters().equals("@")) {
|
||||
return 1;
|
||||
} else {
|
||||
return o1.getSortLetters().compareTo(o2.getSortLetters());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.smssdk.SMSSDK;
|
||||
|
||||
public class GetCountryList {
|
||||
|
||||
private HashMap<Character, ArrayList<String[]>> first;
|
||||
private ArrayList<String[]> second;
|
||||
// String countyList="\n";
|
||||
private ArrayList<Country> dataList;
|
||||
// 汉字转换成拼音的类
|
||||
private CharacterParser characterParser;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public ArrayList<Country> getCountry(HashMap<Character, ArrayList<String[]>> list){
|
||||
//实例化汉字转拼音类
|
||||
characterParser = CharacterParser.getInstance();
|
||||
dataList=new ArrayList<>();
|
||||
first = SMSSDK.getGroupedCountryList();
|
||||
Set set=first.keySet();
|
||||
for(Object obj : set){
|
||||
// System.out.println("第一层"+first.get(obj));
|
||||
second=first.get(obj);
|
||||
// System.out.println("第二层"+second);
|
||||
for(int i = 0;i<second.toArray().length;i++){
|
||||
Country country=new Country();
|
||||
String[] thirst =second.get(i);
|
||||
country.setCountry(thirst[0]);
|
||||
country.setCountryCode("+"+thirst[1]);
|
||||
|
||||
//汉字转换成拼音
|
||||
String pinyin = characterParser.getSelling(thirst[0]);
|
||||
String sortString = pinyin.substring(0, 1).toUpperCase();
|
||||
|
||||
// 正则表达式,判断首字母是否是英文字母
|
||||
if (sortString.matches("[A-Z]")) {
|
||||
country.setSortLetters(sortString.toUpperCase().toUpperCase());
|
||||
} else {
|
||||
country.setSortLetters("#");
|
||||
}
|
||||
|
||||
dataList.add(country);
|
||||
// System.out.println("第三层"+thirst);
|
||||
// System.out.println("实际数据"+thirst[0]+"国家"+thirst[1]);
|
||||
// String str=thirst[0]+"----------"+thirst[1]+"区域号\n";
|
||||
// countyList = countyList+str;
|
||||
}
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,186 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.luyin.services.EmergencyPeople;
|
||||
import com.example.luyin.services.User_Bmob;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.luyin.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cn.bmob.v3.exception.BmobException;
|
||||
import cn.bmob.v3.listener.SaveListener;
|
||||
|
||||
public class RegisterActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
|
||||
SharedPreferences prefs;
|
||||
private String realCode;
|
||||
private DBOpenHelper mDBOpenHelper;
|
||||
private Button mBtRegisteractivityRegister;
|
||||
private RelativeLayout mRlRegisteractivityTop;
|
||||
private ImageView mIvRegisteractivityBack;
|
||||
private LinearLayout mLlRegisteractivityBody;
|
||||
private EditText mEtRegisteractivityUsername;
|
||||
private EditText mEtRegisteractivityPassword1;
|
||||
private EditText mEtRegisteractivityPassword2;
|
||||
private EditText mEtRegisteractivityPhonecodes;
|
||||
private ImageView mIvRegisteractivityShowcode;
|
||||
private RelativeLayout mRlRegisteractivityBottom;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_register);
|
||||
initView();
|
||||
|
||||
mDBOpenHelper = new DBOpenHelper(this);
|
||||
|
||||
prefs = getSharedPreferences("userlogin", MODE_PRIVATE);
|
||||
|
||||
//将验证码用图片的形式显示出来
|
||||
mIvRegisteractivityShowcode.setImageBitmap(Code.getInstance().createBitmap());
|
||||
realCode = Code.getInstance().getCode().toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initView(){
|
||||
mBtRegisteractivityRegister = findViewById(R.id.bt_registeractivity_register);
|
||||
mRlRegisteractivityTop = findViewById(R.id.rl_registeractivity_top);
|
||||
mIvRegisteractivityBack = findViewById(R.id.iv_registeractivity_back);
|
||||
mLlRegisteractivityBody = findViewById(R.id.ll_registeractivity_body);
|
||||
mEtRegisteractivityUsername = findViewById(R.id.et_registeractivity_username);
|
||||
mEtRegisteractivityPassword1 = findViewById(R.id.et_registeractivity_password1);
|
||||
mEtRegisteractivityPassword2 = findViewById(R.id.et_registeractivity_password2);
|
||||
mEtRegisteractivityPhonecodes = findViewById(R.id.et_registeractivity_phoneCodes);
|
||||
mIvRegisteractivityShowcode = findViewById(R.id.iv_registeractivity_showCode);
|
||||
mRlRegisteractivityBottom = findViewById(R.id.rl_registeractivity_bottom);
|
||||
|
||||
/**
|
||||
* 注册页面能点击的就三个地方
|
||||
* top处返回箭头、刷新验证码图片、注册按钮
|
||||
*/
|
||||
mIvRegisteractivityBack.setOnClickListener(this);
|
||||
mIvRegisteractivityShowcode.setOnClickListener(this);
|
||||
mBtRegisteractivityRegister.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
int idman=0;
|
||||
switch (view.getId()) {
|
||||
case R.id.iv_registeractivity_back: //返回登录页面
|
||||
Intent intent1 = new Intent(this, LoginActivity.class);
|
||||
startActivity(intent1);
|
||||
finish();
|
||||
break;
|
||||
case R.id.iv_registeractivity_showCode: //改变随机验证码的生成
|
||||
mIvRegisteractivityShowcode.setImageBitmap(Code.getInstance().createBitmap());
|
||||
realCode = Code.getInstance().getCode().toLowerCase();
|
||||
break;
|
||||
case R.id.bt_registeractivity_register: //注册按钮
|
||||
//获取用户输入的用户名、密码、验证码
|
||||
String phonenumber = mEtRegisteractivityUsername.getText().toString().trim();
|
||||
String password = mEtRegisteractivityPassword1.getText().toString().trim();
|
||||
String password2=mEtRegisteractivityPassword2.getText().toString().trim();
|
||||
String phoneCode = mEtRegisteractivityPhonecodes.getText().toString().toLowerCase();
|
||||
|
||||
//电话号码和密码注册检测
|
||||
boolean canRegister=false;
|
||||
String telRegex = "[1][3456789]\\d{9}";
|
||||
if(TextUtils.isEmpty(phonenumber)){
|
||||
Toast toast= Toast.makeText(com.example.luyin.activities.RegisterActivity.this,"电话号码不能为空", Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
else if(!phonenumber.matches(telRegex)){
|
||||
Toast toast= Toast.makeText(com.example.luyin.activities.RegisterActivity.this,"电话号码格式不正确,请重新输入", Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
|
||||
else if(!password.equals(password2)){
|
||||
Toast toast= Toast.makeText(com.example.luyin.activities.RegisterActivity.this,"两次的密码不一致", Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
else{
|
||||
canRegister=true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//注册验证
|
||||
if (canRegister && !TextUtils.isEmpty(password) && !TextUtils.isEmpty(phoneCode) ) {
|
||||
if (phoneCode.equals(realCode)) {
|
||||
//将用户名和密码加入到数据库中
|
||||
mDBOpenHelper.add(phonenumber, password,phonenumber,"男","1970/01/01","健康","您还未填写地址","");
|
||||
|
||||
ArrayList<User> data = mDBOpenHelper.getAllData();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
User user = data.get(i);
|
||||
if (phonenumber.equals(user.getPhonenumber()) && password.equals(user.getPassword())) {
|
||||
idman=user.get_id();
|
||||
savePreferences(phonenumber,password,user.getName(),user.getSex());
|
||||
}
|
||||
}
|
||||
|
||||
// Intent intent2 = new Intent(this, ManinfoshowActivity.class);
|
||||
// intent2.putExtra("idman",idman);
|
||||
// startActivity(intent2);
|
||||
finish();
|
||||
Toast.makeText(this, "验证通过,注册成功", Toast.LENGTH_SHORT).show();
|
||||
//存到数据库
|
||||
User_Bmob people1 = new User_Bmob();
|
||||
people1.setNameOrPhone(phonenumber);
|
||||
people1.setpassword(password);
|
||||
people1.save(new SaveListener<String>() {
|
||||
@Override
|
||||
public void done(String s, BmobException e) {
|
||||
if (e == null) {
|
||||
// Toast.makeText(getApplicationContext(), "添加联系人成功", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
// Toast.makeText(getApplicationContext(), "添加失败", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Toast.makeText(this, "验证码错误,注册失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}else {
|
||||
Toast.makeText(this, "未完善信息,注册失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void savePreferences(String phonenumber, String password, String name, String sex){
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putString("account", phonenumber);
|
||||
editor.putString("password", password);
|
||||
editor.putString("name", name);
|
||||
editor.putString("sex", sex);
|
||||
editor.apply();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.SmsManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.luyin.R;
|
||||
|
||||
public class SMS extends Activity {
|
||||
|
||||
private EditText mNumberText;
|
||||
private EditText mContentText;
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setTitle(getString(R.string.app_name));
|
||||
setContentView(R.layout.activity_sms);
|
||||
|
||||
mNumberText = (EditText)this.findViewById(R.id.number);//找到number
|
||||
mContentText = (EditText)this.findViewById(R.id.msg_content);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void SEND(View view) {
|
||||
|
||||
|
||||
//String content = mContentText.getText().toString();
|
||||
//String number = mNumberText.getText().toString();
|
||||
String content = "尼玛1111111111111111";
|
||||
String number = "18577348433";
|
||||
|
||||
if(TextUtils.isEmpty(number)){
|
||||
showToast("请输入手机号");
|
||||
return;
|
||||
}
|
||||
if(TextUtils.isEmpty(content)){
|
||||
showToast("请输入内容");
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<String> messages = SmsManager.getDefault().divideMessage(content);
|
||||
for(String text : messages){
|
||||
SmsManager.getDefault().sendTextMessage(number, null, text, null, null);
|
||||
}
|
||||
showToast("success");
|
||||
}
|
||||
|
||||
private void showToast(String msg) {
|
||||
Toast.makeText(SMS.this, msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,165 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.luyin.R;
|
||||
|
||||
|
||||
public class SecurityCodeView extends RelativeLayout {
|
||||
private EditText editText;
|
||||
private TextView[] TextViews;
|
||||
private StringBuffer stringBuffer = new StringBuffer();
|
||||
private int count = 6;
|
||||
private String inputContent;
|
||||
|
||||
public SecurityCodeView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public SecurityCodeView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public SecurityCodeView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
TextViews = new TextView[6];
|
||||
View.inflate(context, R.layout.view_security_code, this);
|
||||
|
||||
editText = (EditText) findViewById(R.id.item_edittext);
|
||||
TextViews[0] = (TextView) findViewById(R.id.item_code_iv1);
|
||||
TextViews[1] = (TextView) findViewById(R.id.item_code_iv2);
|
||||
TextViews[2] = (TextView) findViewById(R.id.item_code_iv3);
|
||||
TextViews[3] = (TextView) findViewById(R.id.item_code_iv4);
|
||||
TextViews[4] = (TextView) findViewById(R.id.item_code_iv5);
|
||||
TextViews[5] = (TextView) findViewById(R.id.item_code_iv6);
|
||||
|
||||
editText.setCursorVisible(false);//将光标隐藏
|
||||
setListener();
|
||||
}
|
||||
|
||||
private void setListener() {
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
//重点 如果字符不为""时才进行操作
|
||||
if (!editable.toString().equals("")) {
|
||||
if (stringBuffer.length() > 5) {
|
||||
//当文本长度大于5位时edittext置空
|
||||
editText.setText("");
|
||||
return;
|
||||
} else {
|
||||
//将文字添加到StringBuffer中
|
||||
stringBuffer.append(editable);
|
||||
editText.setText("");//添加后将EditText置空 造成没有文字输入的错局
|
||||
// Log.e("TAG", "afterTextChanged: stringBuffer is " + stringBuffer);
|
||||
count = stringBuffer.length();//记录stringbuffer的长度
|
||||
inputContent = stringBuffer.toString();
|
||||
if (stringBuffer.length() == 6) {
|
||||
//文字长度位4 则调用完成输入的监听
|
||||
if (inputCompleteListener != null) {
|
||||
inputCompleteListener.inputComplete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < stringBuffer.length(); i++) {
|
||||
TextViews[i].setText(String.valueOf(inputContent.charAt(i)));
|
||||
TextViews[i].setBackgroundResource(R.mipmap.bg_verify_press);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editText.setOnKeyListener(new OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_DEL
|
||||
&& event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
if (onKeyDelete()) return true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public boolean onKeyDelete() {
|
||||
if (count == 0) {
|
||||
count = 6;
|
||||
return true;
|
||||
}
|
||||
if (stringBuffer.length() > 0) {
|
||||
//删除相应位置的字符
|
||||
stringBuffer.delete((count - 1), count);
|
||||
count--;
|
||||
// Log.e(TAG, "afterTextChanged: stringBuffer is " + stringBuffer);
|
||||
inputContent = stringBuffer.toString();
|
||||
TextViews[stringBuffer.length()].setText("");
|
||||
TextViews[stringBuffer.length()].setBackgroundResource(R.mipmap.bg_verify);
|
||||
if (inputCompleteListener != null)
|
||||
inputCompleteListener.deleteContent(true);//有删除就通知manger
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空输入内容
|
||||
*/
|
||||
public void clearEditText() {
|
||||
stringBuffer.delete(0, stringBuffer.length());
|
||||
inputContent = stringBuffer.toString();
|
||||
for (int i = 0; i < TextViews.length; i++) {
|
||||
TextViews[i].setText("");
|
||||
TextViews[i].setBackgroundResource(R.mipmap.bg_verify);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private InputCompleteListener inputCompleteListener;
|
||||
|
||||
public void setInputCompleteListener(InputCompleteListener inputCompleteListener) {
|
||||
this.inputCompleteListener = inputCompleteListener;
|
||||
}
|
||||
|
||||
public interface InputCompleteListener {
|
||||
void inputComplete();
|
||||
|
||||
void deleteContent(boolean isDelete);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取输入文本
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getEditContent() {
|
||||
return inputContent;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package com.example.luyin.activities;
|
||||
|
||||
/**
|
||||
* Created by littlecurl 2018/6/24
|
||||
*/
|
||||
public class User {
|
||||
private int _id;
|
||||
private String phonenumber;
|
||||
private String password;
|
||||
private String name;
|
||||
private String sex;
|
||||
private String birth;
|
||||
private String healthstate;
|
||||
private String address;
|
||||
private String idcard;
|
||||
|
||||
|
||||
|
||||
//密码
|
||||
public User(int _id, String phonenumber, String password, String name, String sex, String birth, String healthstate, String address, String idcard) {
|
||||
this._id=_id;
|
||||
this.phonenumber = phonenumber;
|
||||
this.password = password;
|
||||
this.name = name;
|
||||
this.sex = sex;
|
||||
this.birth = birth;
|
||||
this.healthstate = healthstate;
|
||||
this.address = address;
|
||||
this.idcard = idcard;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int get_id() {
|
||||
return _id;
|
||||
}
|
||||
|
||||
public void set_id(int _id) {
|
||||
this._id = _id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirth() {
|
||||
return birth;
|
||||
}
|
||||
|
||||
public void setBirth(String birth) {
|
||||
this.birth = birth;
|
||||
}
|
||||
|
||||
public String getHealthstate() {
|
||||
return healthstate;
|
||||
}
|
||||
|
||||
public void setHealthstate(String healthstate) {
|
||||
this.healthstate = healthstate;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getIdcard() {
|
||||
return idcard;
|
||||
}
|
||||
|
||||
public void setIdcard(String idcard) {
|
||||
this.idcard = idcard;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" +
|
||||
"name='" + name + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.example.luyin.services;
|
||||
|
||||
import cn.bmob.v3.BmobObject;
|
||||
|
||||
public class User_Bmob extends BmobObject {
|
||||
|
||||
private String NameOrPhone;
|
||||
|
||||
private String password;
|
||||
|
||||
public String getNameOrPhone(){
|
||||
return NameOrPhone;
|
||||
}
|
||||
public void setNameOrPhone(String NameOrPhone) {
|
||||
this.NameOrPhone = NameOrPhone;
|
||||
}
|
||||
public String getpassword() {
|
||||
return password;
|
||||
}
|
||||
public void setpassword(String password) {
|
||||
this.password=password;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 388 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 356 B |
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--默认情况下是一个带圆角,蓝色背景,白色边框的矩形-->
|
||||
<!--第二种方法-->
|
||||
<item android:state_window_focused="false">
|
||||
<shape android:shape="rectangle">
|
||||
<!--圆角-->
|
||||
<corners android:radius="5dp" />
|
||||
<!--填充颜色-->
|
||||
<solid android:color="@color/colorPrimary" />
|
||||
<!--描边-->
|
||||
<stroke android:width="1dp" android:color="#fff" />
|
||||
</shape>
|
||||
</item>
|
||||
<!--单击时是一个带圆角,绿色背景,白色边框的矩形-->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<!--圆角-->
|
||||
<corners android:radius="5dp" />
|
||||
<!--填充颜色-->
|
||||
<solid android:color="#008B8B" />
|
||||
<!--描边-->
|
||||
<stroke android:width="1dp" android:color="#fff" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/titleBackground"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center|left"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="返回"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="国家"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.3dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/country_lvcountry"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:scrollbars="none"
|
||||
android:divider="@null"
|
||||
android:fastScrollEnabled="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@mipmap/show_toast_bg"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="30sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<com.example.luyin.activities.SideBar
|
||||
android:id="@+id/sidrbar"
|
||||
android:layout_width="33dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right|center" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="紧急联系人:"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/contact"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系方式:"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/phonenumber"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="confirm"
|
||||
|
||||
android:text="确定"
|
||||
|
||||
android:textColor="#0000ff"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,138 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#eeeeee"
|
||||
|
||||
tools:context=".activities.LoginActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_loginactivity_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:background="@color/colorPrimary" >
|
||||
<ImageView
|
||||
android:id="@+id/iv_loginactivity_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/ic_left_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="登录"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:layout_toRightOf="@+id/iv_loginactivity_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="注册"
|
||||
android:textColor="#fff"
|
||||
android:textSize="15dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="30dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_loginactivity_two"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/rl_loginactivity_top"
|
||||
android:layout_marginTop="200dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户名:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_loginactivity_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="手机号"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="密 码:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_loginactivity_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="登录密码"
|
||||
android:inputType="textPassword"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/bt_loginactivity_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/ll_loginactivity_two"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/selector_loginactivity_button"
|
||||
android:text="登录"
|
||||
android:textColor="#fff"
|
||||
android:gravity="center"
|
||||
android:onClick="onClick"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_forget"
|
||||
android:text="忘记密码"
|
||||
android:textColor="@color/RoyalBlue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginVertical="50dp"
|
||||
android:layout_below="@+id/bt_loginactivity_login"
|
||||
android:layout_alignLeft="@+id/bt_loginactivity_login"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_check"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="短信验证码登录"
|
||||
android:textColor="@color/RoyalBlue"
|
||||
android:layout_marginRight="50dp"
|
||||
android:layout_marginVertical="50dp"
|
||||
android:layout_below="@+id/bt_loginactivity_login"
|
||||
android:layout_alignRight="@+id/bt_loginactivity_login"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/user_sign"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,175 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.example.luyin.activities.RegisterActivity"
|
||||
android:background="#eeeeee"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_registeractivity_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:background="@color/colorPrimary"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_registeractivity_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/ic_left_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_registeractivity_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="注册"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:layout_toRightOf="@+id/iv_registeractivity_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="20dp"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_registeractivity_body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_below="@+id/rl_registeractivity_top"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
>
|
||||
<!-- 第一个文本编辑框 输入用户名 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_registeractivity_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="用户名:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_registeractivity_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="请输入手机号"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<!-- 第二个文本编辑框 输入密码 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_registeractivity_password1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="密 码:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_registeractivity_password1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
android:hint="请输入密码" />
|
||||
</LinearLayout>
|
||||
<!-- 第三个文本编辑框 再次输入密码 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_registeractivity_password2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="密 码:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_registeractivity_password2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="请再次输入密码"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<!-- 验证码部分 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal" >
|
||||
<!-- 第四个文本编辑框 输入验证码 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_registeractivity_phoneCodes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="验证码:"/>
|
||||
<EditText
|
||||
android:id="@+id/et_registeractivity_phoneCodes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:hint="请输入4位验证码" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_registeractivity_showCode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_weight="1.5"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
android:layout_marginTop="-10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<!-- 注册按钮 -->
|
||||
<Button
|
||||
android:id="@+id/bt_registeractivity_register"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="@drawable/selector_loginactivity_button"
|
||||
android:textColor="#fff"
|
||||
android:text="注册"
|
||||
android:onClick="onClick"
|
||||
android:layout_marginTop="40dp"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/rl_registeractivity_bottom"
|
||||
android:layout_marginTop="10dp"
|
||||
>
|
||||
<TextView
|
||||
android:layout_centerInParent="true"
|
||||
android:text="注册即代表同意《用户协议》"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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">
|
||||
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_loginactivity_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:background="@color/colorPrimary" >
|
||||
<ImageView
|
||||
android:id="@+id/iv_maillogin_back"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/ic_left_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:clickable="true"
|
||||
android:onClick="onClick"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_loginactivity_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="短信验证"
|
||||
android:textColor="#fff"
|
||||
android:textSize="20dp"
|
||||
android:layout_toRightOf="@+id/iv_loginactivity_back"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="180dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="国 家:"
|
||||
android:textColor="#222222"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCountryCode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="中国 +86"
|
||||
android:padding="10dp"
|
||||
android:textColor="#0000ff"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="手机号:"
|
||||
android:textColor="#222222"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etPhoneNumber"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@null"
|
||||
android:drawablePadding="10dp"
|
||||
android:hint="请输入手机号"
|
||||
android:inputType="phone"
|
||||
android:lines="0"
|
||||
android:maxLength="20"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textColorHint="#cccccc"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="验证码:"
|
||||
android:textColor="#222222"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etCode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="phone"
|
||||
android:lines="0"
|
||||
android:maxLength="6"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textColorHint="#cccccc"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendMsg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:text="获取验证码"
|
||||
android:textColor="#0000ff"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSubmitCode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginRight="30dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:gravity="center"
|
||||
android:text="验证注册"
|
||||
android:textColor="#0000ff"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/catalog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/titleBackground"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="A"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="23dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:text="hhhh"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:text="hhhh"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="40dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入邮箱账号"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:inputType="numberPassword"
|
||||
android:hint="设置密码"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:inputType="numberPassword"
|
||||
android:hint="确认密码"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="立即注册"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="40dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_phone_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入手机号码"
|
||||
android:cursorVisible="false"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_get_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="获取验证码"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="47dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="5">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv1"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv2"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv3"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv4"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv5"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_code_iv6"
|
||||
style="@style/text_editStyle" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/item_edittext"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:inputType="number" />
|
||||
</RelativeLayout>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#008577</color>
|
||||
<color name="colorPrimaryDark">#00574B</color>
|
||||
<color name="LimeGreen">#32CD32</color>
|
||||
<color name="SpringGreen">#3CB371</color>
|
||||
<color name="greenyellow">#adff2f</color>
|
||||
<color name="yellowgreen">#9acd32</color>
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
<color name="DarkOrchid">#9932CC</color>
|
||||
<color name="RoyalBlue">#4169E1</color>
|
||||
<color name="DoderBlue">#1E90FF</color>
|
||||
<color name="powderblue">#afeeee</color>
|
||||
<color name="turquoise">#40e0d0</color>
|
||||
<color name="DarkKhaki">#BDB76B</color>
|
||||
<color name="Gold">#FFD700</color>
|
||||
<color name="Beige">#F5F5DC</color>
|
||||
<color name="LightGoldenrodYellow">#FAFAD2</color>
|
||||
<color name="DarkOrange">#FF8C00</color>
|
||||
<color name="LightCoral">#F08080</color>
|
||||
<color name="orangered">#ff4500</color>
|
||||
<color name="crimson">#dc143c</color>
|
||||
<color name="deeppink">#ff1493</color>
|
||||
<color name="fuchsia">#ff00ff</color>
|
||||
<color name="palevioletred">#db7093</color>
|
||||
<color name="plum">#dda0dd</color>
|
||||
<color name="IndianRed">#CD5C5C</color>
|
||||
<color name="DarkRed">#8B0000</color>
|
||||
<color name="orchid">#da70d6</color>
|
||||
<color name="LightSlateGray">#778899</color>
|
||||
<color name="DimGray">#696969</color>
|
||||
<color name="NavajoWhite">#FFDEAD</color>
|
||||
<color name="black">#000000</color>
|
||||
<color name="white">#ffffff</color>
|
||||
<color name="color_minefragment_top">#20B2AA</color>
|
||||
</resources>
|
||||
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DevInfor>
|
||||
<SinaWeibo AppKey="568898243" AppSecret="38a4f8204cc784f81f9f0daaf31e02e3" RedirectUrl="http://www.sharesdk.cn" />
|
||||
<TencentWeibo Enable="false" />
|
||||
<Douban Enable="false" />
|
||||
<QZone AppId="100371282" AppKey="aed9b0303e3ed1e27bae87c33761161d" />
|
||||
<Renren Enable="false" />
|
||||
<KaiXin Enable="false" />
|
||||
<Facebook Enable="false" />
|
||||
<Twitter Enable="false" />
|
||||
<Evernote Enable="false" />
|
||||
<FourSquare Enable="false" />
|
||||
<GooglePlus Enable="false" />
|
||||
<Instagram Enable="false" />
|
||||
<LinkedIn Enable="false" />
|
||||
<Tumblr Enable="false" />
|
||||
<Email Enable="false" />
|
||||
<ShortMessage Enable="true" />
|
||||
<Wechat AppId="wx4868b35061f87885" AppSecret="64020361b8ec4c99936c0e3999a9f249" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="2" />
|
||||
<WechatMoments AppId="wx4868b35061f87885" AppSecret="64020361b8ec4c99936c0e3999a9f249" />
|
||||
<QQ AppId="100371282" AppKey="aed9b0303e3ed1e27bae87c33761161d" />
|
||||
<Instapaper Enable="false" />
|
||||
<Pocket Enable="false" />
|
||||
<YouDao Enable="false" />
|
||||
<Pinterest Enable="false" />
|
||||
<Flickr Enable="false" />
|
||||
<Dropbox Enable="false" />
|
||||
<VKontakte Enable="false" />
|
||||
<WechatFavorite AppId="wx4868b35061f87885" AppSecret="64020361b8ec4c99936c0e3999a9f249" />
|
||||
<Yixin Enable="false" />
|
||||
<YixinMoments Enable="false" />
|
||||
<Mingdao Enable="false" />
|
||||
<Line Enable="false" />
|
||||
<WhatsApp Enable="true" />
|
||||
<KakaoTalk Enable="false" />
|
||||
<KakaoStory Enable="false" />
|
||||
<FacebookMessenger Enable="false" />
|
||||
<Alipay Enable="false" />
|
||||
<AlipayMoments Enable="false" />
|
||||
<Dingding Enable="false" />
|
||||
<Youtube Enable="false" />
|
||||
<Meipai Enable="false" />
|
||||
<Telegram Enable="false" />
|
||||
<Cmcc Enable="false" />
|
||||
<Reddit Enable="false" />
|
||||
<Telecom Enable="false" />
|
||||
<Accountkit Enable="false" />
|
||||
<Douyin AppKey="aw9ivykfjvi4hpwo" AppSecret="42b4caa6bda60bd49f05f06d0a4956e1" />
|
||||
<Wework Enable="false" />
|
||||
<HWAccount Enable="false" />
|
||||
<Oasis Enable="false" />
|
||||
<XMAccount Enable="false" />
|
||||
<SnapChat Enable="false" />
|
||||
<Kuaishou Enable="false" />
|
||||
<Littleredbook Enable="false" />
|
||||
<Watermelonvideo Enable="false" />
|
||||
<Tiktok Enable="false" />
|
||||
</DevInfor>
|
||||