├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── zpfang.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── Clover.iml ├── Clover_Demo_video.mp4 ├── Clover_Display.pptx ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── libs │ ├── BmobIM_V1.1.8beta_20150408.jar │ ├── BmobSDK_V3.4.0_0616.jar │ └── universal-image-loader-1.9.2_sources.jar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── clover │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── clover │ │ ├── adapter │ │ ├── MSListViewAdapter.java │ │ └── MdListViewAdapter.java │ │ ├── entities │ │ ├── Mood.java │ │ ├── Relationship.java │ │ └── User.java │ │ ├── net │ │ ├── BmobRequest.java │ │ ├── MyPushMessageReceiver.java │ │ └── PushMessageReceiver.java │ │ ├── ui │ │ ├── AboutUsActivity.java │ │ ├── AddMoodActivity.java │ │ ├── AnniversaryActivity.java │ │ ├── BaseActivity.java │ │ ├── ChangePasswordActivity.java │ │ ├── ChatActivity.java │ │ ├── DiseaseActivity.java │ │ ├── HealthActivity.java │ │ ├── LoginActivity.java │ │ ├── LoverManagerActivity.java │ │ ├── MainActivity.java │ │ ├── MensesActivity.java │ │ ├── MessageSettingActivity.java │ │ ├── RegisterActivity.java │ │ ├── SettingActivity.java │ │ ├── SpaceActivity.java │ │ ├── TSwapActivity.java │ │ ├── TTTAActivity.java │ │ ├── TTTAPWCActivity.java │ │ ├── TTTATPActivity.java │ │ ├── TZFEActivity.java │ │ ├── UpdateUserNickActivity.java │ │ ├── UserInfoUpdateActivity.java │ │ └── frgms │ │ │ ├── GamePage.java │ │ │ ├── MainPage.java │ │ │ └── UserPage.java │ │ ├── utils │ │ ├── ActivityCollector.java │ │ ├── CloverApplication.java │ │ ├── CommonUtils.java │ │ ├── Config.java │ │ ├── MyDatabase.java │ │ └── PhotoUtils.java │ │ └── view │ │ ├── XListView.java │ │ └── XListViewHeader.java │ └── res │ ├── anim │ └── scaleanim.xml │ ├── drawable │ ├── a.png │ ├── about_bottom_bg.9.png │ ├── about_mid_bg.9.png │ ├── about_top_bg.9.png │ ├── add_mood_selector.xml │ ├── anniversary.png │ ├── anniversary_r.png │ ├── apologize.jpg │ ├── base_edit_input.9.png │ ├── base_horization_line.png │ ├── base_horizontal_line.9.png │ ├── begin.9.png │ ├── best.png │ ├── blank9.9.png │ ├── blank_9.png │ ├── bomb.png │ ├── boring.jpg │ ├── btn_ann_selector.xml │ ├── btn_health_selector.xml │ ├── btn_login_n.9.png │ ├── btn_login_p.9.png │ ├── btn_login_selector.xml │ ├── btn_logout_n.9.png │ ├── btn_logout_p.9.png │ ├── btn_logout_selector.xml │ ├── btn_p10_selector.xml │ ├── btn_p11_selector.xml │ ├── btn_p12_selector.xml │ ├── btn_p1_selector.xml │ ├── btn_p2_selector.xml │ ├── btn_p3_selector.xml │ ├── btn_p4_selector.xml │ ├── btn_p5_selector.xml │ ├── btn_p6_selector.xml │ ├── btn_p7_selector.xml │ ├── btn_p8_selector.xml │ ├── btn_p9_selector.xml │ ├── btn_selector.xml │ ├── chatfrom_bg.xml │ ├── chatfrom_bg_focused.9.png │ ├── chatfrom_bg_normal.9.png │ ├── chatfrom_bg_pressed.9.png │ ├── chatto_bg.xml │ ├── chatto_bg_focused.9.png │ ├── chatto_bg_normal.9.png │ ├── chatto_bg_pressed.9.png │ ├── day.png │ ├── doing.jpg │ ├── head.png │ ├── health.png │ ├── health_r.png │ ├── hug.jpg │ ├── icon.png │ ├── input_bg.9.png │ ├── iv_back_selector.xml │ ├── kiss.jpg │ ├── layout_bg1.9.png │ ├── logo.png │ ├── main_background.png │ ├── miao.jpeg │ ├── miss.jpeg │ ├── newgame.png │ ├── newscore.png │ ├── off.png │ ├── on.png │ ├── p1.png │ ├── p10.png │ ├── p10_r.png │ ├── p11.png │ ├── p11_r.png │ ├── p12.png │ ├── p12_r.png │ ├── p1_r.png │ ├── p2.png │ ├── p2_r.png │ ├── p3.png │ ├── p3_r.png │ ├── p4.png │ ├── p4_r.png │ ├── p5.png │ ├── p5_r.png │ ├── p6.png │ ├── p6_r.png │ ├── p7.png │ ├── p7_r.png │ ├── p8.png │ ├── p8_r.png │ ├── p9.png │ ├── p9_r.png │ ├── pause.png │ ├── photo0.png │ ├── photo1024.png │ ├── photo128.png │ ├── photo16.png │ ├── photo2.png │ ├── photo204.9.png │ ├── photo2048.png │ ├── photo256.png │ ├── photo32.png │ ├── photo4.png │ ├── photo512.png │ ├── photo64.png │ ├── photo8.png │ ├── pop_bg.9.png │ ├── pop_bg_press.9.png │ ├── register_bottom_arrow.png │ ├── set.9.png │ ├── shape.xml │ ├── testgif.gif │ ├── tv_selector.xml │ ├── wang.jpeg │ └── xlistview_arrow.png │ ├── layout │ ├── activity_about_us.xml │ ├── activity_add_mood.xml │ ├── activity_anniversary.xml │ ├── activity_change_password.xml │ ├── activity_chat.xml │ ├── activity_disease.xml │ ├── activity_health.xml │ ├── activity_login.xml │ ├── activity_lover_manager.xml │ ├── activity_main.xml │ ├── activity_menses.xml │ ├── activity_message_setting.xml │ ├── activity_register.xml │ ├── activity_setting.xml │ ├── activity_space.xml │ ├── activity_tswap.xml │ ├── activity_ttta.xml │ ├── activity_tttapwc.xml │ ├── activity_tttatp.xml │ ├── activity_tzfe.xml │ ├── activity_update_user_nick.xml │ ├── activity_user_info_update.xml │ ├── chatting_item_msg_text_left.xml │ ├── chatting_item_msg_text_right.xml │ ├── dialog_apologize_layout.xml │ ├── dialog_boring_layout.xml │ ├── dialog_do_layout.xml │ ├── dialog_hug_layout.xml │ ├── dialog_kiss_layout.xml │ ├── dialog_miao_layout.xml │ ├── dialog_miss_layout.xml │ ├── dialog_wang_layout.xml │ ├── fragment_game_page.xml │ ├── fragment_main_page.xml │ ├── fragment_user_page.xml │ ├── gifview_dialog_layout.xml │ ├── include_interact_getup_reminder.xml │ ├── include_interact_sleep_reminder.xml │ ├── main_bottom_bar.xml │ ├── mood_item.xml │ ├── normalview.xml │ ├── pause.xml │ ├── toolbar_layout.xml │ └── xlistview_header.xml │ ├── mipmap-hdpi │ ├── a.png │ ├── base_horization_line.png │ ├── disease.png │ ├── fine_disease.jpg │ ├── fine_menses.jpg │ ├── ic_launcher.png │ ├── login_icon_account.png │ ├── login_icon_password.png │ ├── logo.png │ ├── menses.jpg │ ├── password.png │ └── person.png │ ├── mipmap-mdpi │ ├── add_mood.png │ ├── add_mood_select.png │ ├── back.png │ ├── back_select.png │ ├── bestscore.png │ ├── ic_launcher.png │ ├── mini_avatar_shadow.png │ ├── mood_add.png │ ├── mood_pic.png │ ├── photo.png │ ├── restar.png │ ├── score.png │ └── send_message.png │ ├── mipmap-xhdpi │ ├── a.png │ ├── base_horization_line.png │ ├── ic_launcher.png │ ├── login_icon_account.png │ ├── login_icon_password.png │ ├── password.png │ ├── person.png │ └── search.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── tb_back.png │ ├── values-w820dp │ ├── attrs.xml │ └── dimens.xml │ └── values │ ├── array.xml │ ├── color.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── document ├── Clover's_user_manual_Android-v1.0.doc ├── v9.8389.2753.3_Project Closure Summary Report_V1.0.doc ├── v9.8389.2753.3_Project Start Report_V1.0.doc ├── v9.8389.2753.3_SD_HLD_V1.0.doc ├── v9.8389.2753.3_Software Project Planning(simple)_V1.0.doc └── v9.8389.2753.3_Software Requirement Specification_V1.0.doc ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | 8 | # Built application files 9 | *.apk 10 | *.ap_ 11 | 12 | # Files for the Dalvik VM 13 | *.dex 14 | 15 | # Java class files 16 | *.class 17 | 18 | # Generated files 19 | bin/ 20 | gen/ 21 | 22 | # Gradle files 23 | .gradle/ 24 | build/ 25 | /*/build/ 26 | 27 | # Local configuration file (sdk path, etc) 28 | local.properties 29 | 30 | # Proguard folder generated by Eclipse 31 | proguard/ 32 | 33 | # Log Files 34 | *.log 35 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Clover -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/zpfang.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | hwhf 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | Android API 15 Platform 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Clover.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Clover_Demo_video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/Clover_Demo_video.mp4 -------------------------------------------------------------------------------- /Clover_Display.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/Clover_Display.pptx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clover 2 | Clover(恋爱管家)是一款专门为情侣设计的私密社交应用。它是一个绝佳的交流、分享、记录工具,支持文字、图片的发布和浏览,并且所有记录都能在不同安卓设备中无缝同步。此外,它还提供聊天、情侣游戏、健康提醒、情侣互动等多项功能。这款应用让情侣的沟通更有乐趣,丰富二人生活。 Clover让lover更closer! 3 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "23.0.0 rc2" 6 | 7 | defaultConfig { 8 | applicationId "com.clover" 9 | minSdkVersion 15 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | compile 'com.android.support:appcompat-v7:22.1.1' 25 | compile 'com.wdullaer:materialdatetimepicker:1.3.1' 26 | compile files('libs/BmobSDK_V3.4.0_0616.jar') 27 | compile files('libs/BmobIM_V1.1.8beta_20150408.jar') 28 | compile 'com.github.fengdai:alertdialogpro-theme-material:0.2.3' 29 | compile files('libs/universal-image-loader-1.9.2_sources.jar') 30 | } 31 | -------------------------------------------------------------------------------- /app/libs/BmobIM_V1.1.8beta_20150408.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/libs/BmobIM_V1.1.8beta_20150408.jar -------------------------------------------------------------------------------- /app/libs/BmobSDK_V3.4.0_0616.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/libs/BmobSDK_V3.4.0_0616.jar -------------------------------------------------------------------------------- /app/libs/universal-image-loader-1.9.2_sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/libs/universal-image-loader-1.9.2_sources.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Android Studio\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/clover/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.clover; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/clover/adapter/MdListViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.clover.adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.BaseAdapter; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.clover.R; 13 | import com.clover.entities.Mood; 14 | import com.nostra13.universalimageloader.core.DisplayImageOptions; 15 | import com.nostra13.universalimageloader.core.ImageLoader; 16 | import com.nostra13.universalimageloader.core.assist.ImageScaleType; 17 | import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer; 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * Created by dan on 2015/6/29. 23 | */ 24 | public class MdListViewAdapter extends BaseAdapter{ 25 | private Context context; 26 | private List moodList; 27 | 28 | public MdListViewAdapter(Context context, List moodList) { 29 | this.context = context; 30 | this.moodList = moodList; 31 | } 32 | 33 | @Override 34 | public int getCount() { 35 | return moodList.size(); 36 | } 37 | 38 | @Override 39 | public Mood getItem(int position) { 40 | return moodList.get(position); 41 | } 42 | 43 | @Override 44 | public long getItemId(int position) { 45 | return position; 46 | } 47 | 48 | @Override 49 | public View getView(int position, View convertView, ViewGroup parent) { 50 | int newPosition = getCount()-1-position; 51 | Mood mood = getItem(newPosition); 52 | View view; 53 | ViewHolder viewHolder; 54 | // if(convertView == null){ 55 | viewHolder = new ViewHolder(); 56 | view = LayoutInflater.from(context).inflate(R.layout.mood_item, null); 57 | viewHolder.tv_mood = (TextView) view.findViewById(R.id.tv_mood); 58 | viewHolder.tv_date = (TextView) view.findViewById(R.id.tv_date); 59 | viewHolder.iv_mood = (ImageView) view.findViewById(R.id.iv_mood); 60 | // view.setTag(viewHolder); 61 | // }else{ 62 | // view = convertView; 63 | // viewHolder = (ViewHolder) view.getTag(); 64 | // } 65 | viewHolder.tv_mood.setText(mood.getMd_content()); 66 | viewHolder.tv_date.setText(dateFormat(mood.getCreatedAt().toString())); 67 | if(newPosition!=0){ 68 | if(dateFormat(getItem(newPosition-1).getCreatedAt()).equals(dateFormat(getItem(newPosition).getCreatedAt()))){ 69 | viewHolder.tv_date.setVisibility(View.INVISIBLE); 70 | } 71 | } 72 | 73 | // if(mood.getMd_path()!=null&&(!mood.getMd_path().equals(""))){ 74 | // viewHolder.iv_mood.setVisibility(View.VISIBLE); 75 | ImageLoader.getInstance().displayImage(mood.getMd_path(), viewHolder.iv_mood, 76 | new DisplayImageOptions.Builder() 77 | .cacheInMemory(true) 78 | .cacheOnDisc(true) 79 | .considerExifParams(true) 80 | .imageScaleType(ImageScaleType.EXACTLY)//设置图片编码方式 81 | .bitmapConfig(Bitmap.Config.RGB_565)// 设置图片的解码类型 82 | .considerExifParams(true) 83 | .resetViewBeforeLoading(true) 84 | .displayer(new FadeInBitmapDisplayer(100))// 淡入 85 | .build()); 86 | // }else { 87 | // viewHolder.iv_mood.setVisibility(View.GONE); 88 | // } 89 | 90 | 91 | return view; 92 | } 93 | 94 | public class ViewHolder{ 95 | TextView tv_mood; 96 | ImageView iv_mood; 97 | TextView tv_date; 98 | } 99 | 100 | public String dateFormat(String date){ 101 | String month = date.substring(5,7); 102 | String day = date.substring(8,10); 103 | 104 | return month+"."+day; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/entities/Mood.java: -------------------------------------------------------------------------------- 1 | package com.clover.entities; 2 | 3 | import cn.bmob.v3.BmobObject; 4 | 5 | /** 6 | * Created by dan on 2015/6/29. 7 | */ 8 | public class Mood extends BmobObject{ 9 | private String md_content; 10 | private String md_path; 11 | private String belongId; 12 | 13 | public String getMd_content() { 14 | return md_content; 15 | } 16 | 17 | public void setMd_content(String md_content) { 18 | this.md_content = md_content; 19 | } 20 | 21 | public String getMd_path() { 22 | return md_path; 23 | } 24 | 25 | public void setMd_path(String md_path) { 26 | this.md_path = md_path; 27 | } 28 | 29 | public String getBelongId() { 30 | return belongId; 31 | } 32 | 33 | public void setBelongId(String belongId) { 34 | this.belongId = belongId; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/entities/Relationship.java: -------------------------------------------------------------------------------- 1 | package com.clover.entities; 2 | 3 | import cn.bmob.v3.BmobObject; 4 | 5 | /** 6 | * Created by dan on 2015/6/29. 7 | */ 8 | public class Relationship extends BmobObject{ 9 | private User m_user; 10 | private User w_user; 11 | private String date; 12 | 13 | public User getM_user() { 14 | return m_user; 15 | } 16 | 17 | public User getW_user() { 18 | return w_user; 19 | } 20 | 21 | public void setM_user(User m_user) { 22 | this.m_user = m_user; 23 | } 24 | 25 | public void setW_user(User w_user) { 26 | this.w_user = w_user; 27 | } 28 | 29 | public String getDate() { 30 | return date; 31 | } 32 | 33 | public void setDate(String date) { 34 | this.date = date; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/entities/User.java: -------------------------------------------------------------------------------- 1 | package com.clover.entities; 2 | 3 | import cn.bmob.im.bean.BmobChatUser; 4 | 5 | public class User extends BmobChatUser { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | private Integer age; 10 | 11 | private Boolean sex; //男-false-女-true 12 | 13 | private Integer sleep=2; 14 | 15 | private Integer disease=2; 16 | 17 | private Integer menses=2; 18 | 19 | public Integer getAge() { 20 | return age; 21 | } 22 | 23 | public void setAge(Integer age) { 24 | this.age = age; 25 | } 26 | 27 | public Boolean getSex() { 28 | return sex; 29 | } 30 | 31 | public void setSex(Boolean sex) { 32 | this.sex = sex; 33 | } 34 | 35 | public Integer getSleep() { 36 | return sleep; 37 | } 38 | 39 | public void setSleep(Integer sleep) { 40 | this.sleep = sleep; 41 | } 42 | 43 | public Integer getDisease() { 44 | return disease; 45 | } 46 | 47 | public void setDisease(Integer disease) { 48 | this.disease = disease; 49 | } 50 | 51 | public Integer getMenses() { 52 | return menses; 53 | } 54 | 55 | public void setMenses(Integer menses) { 56 | this.menses = menses; 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/net/BmobRequest.java: -------------------------------------------------------------------------------- 1 | package com.clover.net; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | import com.clover.R; 7 | import com.clover.entities.User; 8 | import com.clover.utils.CommonUtils; 9 | 10 | import java.util.List; 11 | 12 | import cn.bmob.im.BmobChatManager; 13 | import cn.bmob.im.bean.BmobMsg; 14 | import cn.bmob.v3.BmobQuery; 15 | import cn.bmob.v3.listener.FindListener; 16 | 17 | /** 18 | * Created by dan on 2015/6/29. 19 | */ 20 | public class BmobRequest { 21 | 22 | private User user; 23 | 24 | public BmobRequest(){ 25 | 26 | } 27 | 28 | public void setUser(User user){ 29 | this.user =user; 30 | } 31 | 32 | 33 | public static void pushMessageToLover(String msg, String tag, Context context, String targetId, User user, BmobChatManager manager){ 34 | String pushmsg = msg; 35 | boolean isNetConnected = CommonUtils.isNetworkAvailable(context); 36 | if (!isNetConnected) { 37 | Toast.makeText(context, R.string.network_tips, Toast.LENGTH_LONG).show(); 38 | // return; 39 | } 40 | BmobMsg message = BmobMsg.createTextSendMsg(context, targetId, pushmsg); 41 | message.setExtra(tag); 42 | if(user !=null) { 43 | // 默认发送完成,将数据保存到本地消息表和最近会话表中 44 | manager.sendTextMessage(user, message); 45 | }else{ 46 | Toast.makeText(context, R.string.sorryforquery, Toast.LENGTH_LONG).show(); 47 | } 48 | } 49 | 50 | /** 51 | * 根据id查询用户 52 | */ 53 | public User queryUserById(String objectId, Context context) { 54 | 55 | BmobQuery query = new BmobQuery();query.addWhereEqualTo("objectId", objectId); 56 | query.findObjects(context, new FindListener() { 57 | 58 | @Override 59 | public void onSuccess(List users) { 60 | if(users!=null&&(users.size()>0)){ 61 | user = users.get(0); 62 | } 63 | } 64 | @Override 65 | public void onError(int arg0, String arg1) { 66 | } 67 | }); 68 | return user; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/net/PushMessageReceiver.java: -------------------------------------------------------------------------------- 1 | package com.clover.net; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | /** 8 | * Created by dan on 2015/6/26. 9 | */ 10 | public class PushMessageReceiver extends BroadcastReceiver { 11 | 12 | @SuppressWarnings("deprecation") 13 | @Override 14 | public void onReceive(final Context context, Intent intent) { 15 | String json = intent.getStringExtra("msg"); 16 | Intent intent1 = new Intent("MESSAGE_COMMING"); 17 | intent1.putExtra("msg", json); 18 | context.sendOrderedBroadcast(intent1, null); 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/AboutUsActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import com.clover.R; 7 | 8 | public class AboutUsActivity extends BaseActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_about_us); 14 | initToolbar("关于", new Intent(this, MainActivity.class), this); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/AnniversaryActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.app.DatePickerDialog; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.DatePicker; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import com.clover.R; 14 | import com.clover.entities.Relationship; 15 | import com.clover.entities.User; 16 | import com.clover.utils.CloverApplication; 17 | 18 | import java.text.SimpleDateFormat; 19 | import java.util.Calendar; 20 | import java.util.Date; 21 | 22 | import cn.bmob.v3.listener.UpdateListener; 23 | 24 | 25 | public class AnniversaryActivity extends BaseActivity{ 26 | 27 | private TextView tv_timeUntilNow, tv_anniversaryDate;//到现在的天数,纪念日的日期 28 | private Button btn_save; 29 | CloverApplication application; 30 | User user; 31 | Relationship relationship; 32 | SharedPreferences preferences; 33 | SharedPreferences.Editor editor; 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_anniversary); 38 | 39 | initToolbar(getResources().getString(R.string.title_activity_anniversary),new Intent(this, MainActivity.class), this); 40 | application = (CloverApplication) getApplication(); 41 | preferences = getSharedPreferences("lover", MODE_PRIVATE); 42 | editor = preferences.edit(); 43 | relationship = application.getRelationship(); 44 | user = userManager.getCurrentUser(User.class); 45 | tv_timeUntilNow = (TextView)findViewById(R.id.timeUntilNow); 46 | tv_anniversaryDate = (TextView)findViewById(R.id.anniversaryDate); 47 | btn_save = (Button)findViewById(R.id.save); 48 | 49 | tv_anniversaryDate.setOnClickListener(new View.OnClickListener() { 50 | @Override 51 | public void onClick(View v) { 52 | Calendar now = Calendar.getInstance(); 53 | DatePickerDialog dpd = new DatePickerDialog(AnniversaryActivity.this, 54 | new DatePickerDialog.OnDateSetListener() { 55 | @Override 56 | public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { 57 | monthOfYear = monthOfYear + 1; 58 | String date = year+"-"+ monthOfYear+"-"+dayOfMonth; 59 | tv_anniversaryDate.setText(date); 60 | String nowdate = getNowDate(); 61 | long timetilnow = getcal(date,nowdate); 62 | String timeutilnow = Long.toString(timetilnow); 63 | tv_timeUntilNow.setText(timeutilnow); 64 | } 65 | },now.get(Calendar.YEAR), 66 | now.get(Calendar.MONTH), 67 | now.get(Calendar.DAY_OF_MONTH)); 68 | dpd.show(); 69 | } 70 | }); 71 | btn_save.setOnClickListener(new View.OnClickListener() { 72 | @Override 73 | public void onClick(View v) { 74 | updateAnniversary(); 75 | } 76 | }); 77 | refreshDay(); 78 | } 79 | 80 | public static long getcal(String time1,String time2){ 81 | long js=0; 82 | SimpleDateFormat ft=new SimpleDateFormat("yyyy-MM-dd"); 83 | try{ 84 | Date date1=ft.parse(time1); 85 | Date date2=ft.parse(time2); 86 | js=date2.getTime()-date1.getTime(); 87 | js=js/1000/60/60/24; 88 | }catch(java.text.ParseException e){ 89 | e.printStackTrace(); 90 | } 91 | return js; 92 | } 93 | 94 | private void refreshDay() { 95 | if (preferences.getString("date",getNowDate()) != null) { 96 | tv_anniversaryDate.setText(preferences.getString("date",getNowDate())); 97 | long timetilnow = getcal(preferences.getString("date",getNowDate()), getNowDate()); 98 | String timeutilnow = Long.toString(timetilnow); 99 | tv_timeUntilNow.setText(timeutilnow); 100 | } else { 101 | tv_anniversaryDate.setText(getNowDate()); 102 | tv_timeUntilNow.setText("0"); 103 | } 104 | } 105 | 106 | private void updateAnniversary(){ 107 | Relationship r = new Relationship(); 108 | r.setDate(tv_anniversaryDate.getText().toString()); 109 | r.setObjectId(preferences.getString("reObjectId", "")); 110 | r.update(AnniversaryActivity.this, new UpdateListener() { 111 | @Override 112 | public void onSuccess() { 113 | Toast.makeText(AnniversaryActivity.this, R.string.updatesuccess, Toast.LENGTH_SHORT).show(); 114 | editor.putString("date",tv_anniversaryDate.getText().toString()); 115 | editor.commit(); 116 | } 117 | 118 | @Override 119 | public void onFailure(int i, String s) { 120 | Toast.makeText(AnniversaryActivity.this,R.string.updatefailure, Toast.LENGTH_SHORT).show(); 121 | } 122 | }); 123 | } 124 | 125 | private static String getNowDate(){ 126 | Calendar now = Calendar.getInstance(); 127 | int yearnow = now.get(Calendar.YEAR); 128 | int monthnow = now.get(Calendar.MONTH)+1; 129 | int daynow = now.get(Calendar.DAY_OF_MONTH); 130 | String nowdate = yearnow+"-"+monthnow+"-"+daynow; 131 | return nowdate; 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.Toolbar; 7 | import android.text.TextUtils; 8 | import android.util.Log; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.clover.R; 15 | import com.clover.utils.CloverApplication; 16 | 17 | import cn.bmob.im.BmobChat; 18 | import cn.bmob.im.BmobChatManager; 19 | import cn.bmob.im.BmobUserManager; 20 | 21 | public class BaseActivity extends AppCompatActivity { 22 | 23 | BmobUserManager userManager; 24 | BmobChatManager chatManager; 25 | CloverApplication application; 26 | //String APPID = "551b50c06f7edb512c12fcddbeec4925"; 27 | String APPID = "85e40757e81851d007990f3e103ec5ae"; 28 | private Toolbar toolbar; 29 | 30 | protected void onCreate(android.os.Bundle arg0) { 31 | super.onCreate(arg0); 32 | userManager = BmobUserManager.getInstance(this); 33 | BmobChat.getInstance(this).init(APPID); 34 | chatManager = BmobChatManager.getInstance(this); 35 | application = (CloverApplication) getApplication(); 36 | } 37 | 38 | Toast mToast; 39 | public void ShowToast(final String text) { 40 | if (!TextUtils.isEmpty(text)) { 41 | runOnUiThread(new Runnable() { 42 | 43 | @Override 44 | public void run() { 45 | // TODO Auto-generated method stub 46 | if (mToast == null) { 47 | mToast = Toast.makeText(getApplicationContext(), text, 48 | Toast.LENGTH_SHORT); 49 | } else { 50 | mToast.setText(text); 51 | } 52 | mToast.show(); 53 | } 54 | }); 55 | 56 | } 57 | } 58 | 59 | public void ShowLog(String msg){ 60 | Log.i("zpfang",msg); 61 | } 62 | 63 | public void initToolbar(String str, final Intent intent, final Activity activity){ 64 | ToolbarHolder holder = new ToolbarHolder(); 65 | holder.iv_back = (ImageView) findViewById(R.id.iv_back); 66 | holder.tv_title = (TextView) findViewById(R.id.tv_name); 67 | 68 | holder.tv_title.setText(str); 69 | holder.iv_back.setOnClickListener(new View.OnClickListener() { 70 | @Override 71 | public void onClick(View v) { 72 | startActivity(intent); 73 | activity.finish(); 74 | } 75 | }); 76 | } 77 | 78 | private class ToolbarHolder{ 79 | ImageView iv_back; 80 | TextView tv_title; 81 | } 82 | 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/ChangePasswordActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.text.TextUtils; 6 | import android.view.Menu; 7 | import android.view.MenuItem; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | import android.widget.Toast; 12 | 13 | import com.clover.R; 14 | import com.clover.entities.User; 15 | import com.clover.utils.ActivityCollector; 16 | 17 | import cn.bmob.im.BmobUserManager; 18 | import cn.bmob.im.bean.BmobChatUser; 19 | import cn.bmob.v3.listener.UpdateListener; 20 | 21 | 22 | public class ChangePasswordActivity extends BaseActivity { 23 | 24 | private EditText et_oldpassword;//旧密码 25 | private EditText et_newpassword;//新密码 26 | private EditText et_repeatnewpsd;//重复新密码 27 | private Button btn_finish;//修改完成 28 | //String oldPassword; 29 | String newPassword; 30 | String repeatNewPassword; 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | setContentView(R.layout.activity_change_password); 36 | 37 | initToolbar(getResources().getString(R.string.title_activity_change_password),new Intent(this, SettingActivity.class), this); 38 | 39 | //et_oldpassword = (EditText)findViewById(R.id.oldpassword); 40 | et_newpassword = (EditText)findViewById(R.id.newpassword); 41 | et_repeatnewpsd = (EditText)findViewById(R.id.repeatnewpsd); 42 | btn_finish = (Button)findViewById(R.id.finish); 43 | 44 | btn_finish.setOnClickListener(new View.OnClickListener() { 45 | @Override 46 | public void onClick(View v) { 47 | updatePassword(); 48 | } 49 | }); 50 | } 51 | 52 | private void updatePassword(){ 53 | //oldPassword = et_oldpassword.getText().toString(); 54 | newPassword = et_newpassword.getText().toString(); 55 | repeatNewPassword = et_repeatnewpsd.getText().toString(); 56 | /* 57 | if(TextUtils.isEmpty(oldPassword)){ 58 | Toast.makeText(this, getResources().getString(R.string.inputoldpassword), Toast.LENGTH_SHORT).show(); 59 | return; 60 | } 61 | String old = BmobChatUser.getCurrentUser(this).getPassword(); 62 | if(!oldPassword.equals(userManager.getCurrentUser(User.class).getPassword())){ 63 | Toast.makeText(this, getResources().getString(R.string.wrongoldpassword), Toast.LENGTH_SHORT).show(); 64 | return; 65 | } 66 | */ 67 | if(TextUtils.isEmpty(newPassword)){ 68 | Toast.makeText(this, getResources().getString(R.string.inputnewpassword), Toast.LENGTH_SHORT).show(); 69 | return; 70 | } 71 | if(!newPassword.equals(repeatNewPassword)){ 72 | Toast.makeText(this, getResources().getString(R.string.differentpsd), Toast.LENGTH_SHORT).show(); 73 | return; 74 | } 75 | 76 | final User user = userManager.getCurrentUser(User.class); 77 | User u = new User(); 78 | u.setPassword(newPassword); 79 | u.setObjectId(user.getObjectId()); 80 | u.update(this, new UpdateListener() { 81 | @Override 82 | public void onSuccess() { 83 | Toast.makeText(ChangePasswordActivity.this, R.string.updatesuccess, Toast.LENGTH_SHORT).show(); 84 | BmobUserManager userManager = BmobUserManager.getInstance(ChangePasswordActivity.this); 85 | userManager.logout(); 86 | Intent intent = new Intent(ChangePasswordActivity.this, LoginActivity.class); 87 | startActivity(intent); 88 | ActivityCollector.finishAll(); 89 | } 90 | 91 | @Override 92 | public void onFailure(int i, String s) { 93 | Toast.makeText(ChangePasswordActivity.this,R.string.updatefailure, Toast.LENGTH_SHORT).show(); 94 | } 95 | }); 96 | 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/HealthActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import android.widget.LinearLayout; 8 | import android.widget.RelativeLayout; 9 | 10 | import com.clover.R; 11 | import com.clover.entities.User; 12 | 13 | import java.util.List; 14 | 15 | import cn.bmob.v3.BmobQuery; 16 | import cn.bmob.v3.listener.FindListener; 17 | 18 | 19 | public class HealthActivity extends BaseActivity { 20 | 21 | private RelativeLayout rv_menses;//布局 22 | private RelativeLayout rv_disease;//按钮 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_health); 27 | 28 | initToolbar(getResources().getString(R.string.title_activity_health),new Intent(this, MainActivity.class), this); 29 | initView(); 30 | } 31 | 32 | private void initView(){ 33 | rv_menses = (RelativeLayout)findViewById(R.id.layout_menses); 34 | rv_disease = (RelativeLayout)findViewById(R.id.layout_disease); 35 | 36 | rv_menses.setOnClickListener(new View.OnClickListener() { 37 | @Override 38 | public void onClick(View v) { 39 | Intent intent = new Intent(HealthActivity.this, MensesActivity.class); 40 | startActivity(intent); 41 | } 42 | }); 43 | rv_disease.setOnClickListener(new View.OnClickListener() { 44 | @Override 45 | public void onClick(View v) { 46 | Intent intent = new Intent(HealthActivity.this, DiseaseActivity.class); 47 | startActivity(intent); 48 | } 49 | }); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/LoginActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.text.TextUtils; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | import android.widget.TextView; 11 | 12 | import com.clover.R; 13 | import com.clover.entities.User; 14 | 15 | import cn.bmob.v3.listener.SaveListener; 16 | 17 | 18 | public class LoginActivity extends BaseActivity { 19 | private EditText et_username; 20 | private String username; 21 | private String password; 22 | private EditText et_password; 23 | private Button bt_login; 24 | private TextView register; 25 | private User user; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | // requestWindowFeature(Window.FEATURE_NO_TITLE); 31 | setContentView(R.layout.activity_login); 32 | initView(); 33 | } 34 | 35 | private void initView(){ 36 | register = (TextView)findViewById(R.id.btn_register); 37 | et_username = (EditText) findViewById(R.id.et_username); 38 | et_password = (EditText) findViewById(R.id.et_password); 39 | bt_login = (Button) findViewById(R.id.btn_login); 40 | bt_login.setOnClickListener(new View.OnClickListener() { 41 | @Override 42 | public void onClick(View v) { 43 | checkLogin(); 44 | } 45 | }); 46 | register.setOnClickListener(new View.OnClickListener() { 47 | 48 | @Override 49 | public void onClick(View v) { 50 | Intent intent = new Intent(LoginActivity.this, RegisterActivity.class); 51 | startActivity(intent); 52 | } 53 | }); 54 | } 55 | 56 | private void checkLogin(){ 57 | username = et_username.getText().toString(); 58 | password = et_password.getText().toString(); 59 | if(TextUtils.isEmpty(username)){ 60 | ShowToast("请输入用户名"); 61 | return; 62 | } 63 | if(TextUtils.isEmpty(password)){ 64 | ShowToast("请输入密码"); 65 | return; 66 | } 67 | final ProgressDialog dialog = new ProgressDialog(this); 68 | dialog.setMessage("正在登录"); 69 | dialog.setCancelable(false); 70 | dialog.show(); 71 | user= new User(); 72 | user.setUsername(username); 73 | user.setPassword(password); 74 | userManager.login(user, new SaveListener() { 75 | @Override 76 | public void onSuccess() { 77 | dialog.dismiss(); 78 | Intent intent = new Intent(LoginActivity.this, MainActivity.class); 79 | startActivity(intent); 80 | finish(); 81 | } 82 | 83 | @Override 84 | public void onFailure(int arg0, String arg1) { 85 | ShowToast("登录失败"); 86 | dialog.dismiss(); 87 | } 88 | }); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/LoverManagerActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.text.TextUtils; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | import android.widget.LinearLayout; 11 | import android.widget.TextView; 12 | 13 | import com.clover.R; 14 | import com.clover.entities.Relationship; 15 | import com.clover.entities.User; 16 | import com.clover.utils.CloverApplication; 17 | 18 | import java.util.List; 19 | 20 | import cn.bmob.im.bean.BmobChatUser; 21 | import cn.bmob.im.bean.BmobMsg; 22 | import cn.bmob.v3.BmobQuery; 23 | import cn.bmob.v3.listener.FindListener; 24 | 25 | 26 | public class LoverManagerActivity extends BaseActivity { 27 | private EditText et_lovername; 28 | private Button bt_search; 29 | //搜索后弹出布局 30 | private LinearLayout ll_result; 31 | private TextView tv_lovername; 32 | private Button bt_bind; 33 | 34 | private Boolean isSetLover; 35 | private CloverApplication application; 36 | private User user; 37 | private Relationship relationship; 38 | private User temp_user; 39 | @Override 40 | protected void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | setContentView(R.layout.activity_lover_manager); 43 | application = (CloverApplication) getApplication(); 44 | application.setOne_user(null); 45 | relationship = new Relationship(); 46 | initToolbar("绑定情侣", new Intent(this, MainActivity.class), this); 47 | 48 | initView(); 49 | } 50 | 51 | private void initView(){ 52 | et_lovername = (EditText) findViewById(R.id.et_lovername); 53 | bt_search = (Button) findViewById(R.id.bt_search); 54 | ll_result = (LinearLayout) findViewById(R.id.layout_search_result); 55 | tv_lovername = (TextView) findViewById(R.id.tv_result); 56 | bt_bind = (Button) findViewById(R.id.bt_bind); 57 | 58 | bt_bind.setOnClickListener(new View.OnClickListener() { 59 | @Override 60 | public void onClick(View v) { 61 | if(isSetLover && temp_user != null){ 62 | BmobMsg msg = BmobMsg.createTextSendMsg(LoverManagerActivity.this,temp_user.getObjectId() , BmobChatUser.getCurrentUser(LoverManagerActivity.this).getUsername()); 63 | msg.setExtra("invisitBind"); 64 | chatManager.sendTextMessage(temp_user, msg); 65 | ShowToast("邀请成功"); 66 | bt_bind.setClickable(false); 67 | bt_bind.setText("已邀请"); 68 | 69 | } 70 | } 71 | }); 72 | 73 | bt_search.setOnClickListener(new View.OnClickListener() { 74 | @Override 75 | public void onClick(View v) { 76 | String lovername = et_lovername.getText().toString(); 77 | if(TextUtils.isEmpty(lovername)){ 78 | ShowToast("请输入对方账号"); 79 | return; 80 | } 81 | final ProgressDialog dialog = new ProgressDialog(LoverManagerActivity.this); 82 | dialog.setMessage("正在搜索,请稍等..."); 83 | dialog.setCancelable(true); 84 | dialog.show(); 85 | 86 | 87 | BmobQuery query = new BmobQuery<>(); 88 | query.addWhereEqualTo("username", lovername); 89 | query.findObjects(LoverManagerActivity.this, new FindListener() { 90 | @Override 91 | public void onSuccess(List list) { 92 | if(list.size()>0){ 93 | ll_result.setVisibility(View.VISIBLE); 94 | user = list.get(0); 95 | tv_lovername.setText(user.getUsername()); 96 | temp_user = list.get(0); 97 | isSetLover = true; 98 | dialog.dismiss(); 99 | }else{ 100 | ShowToast("不存在此用户"); 101 | } 102 | 103 | } 104 | 105 | @Override 106 | public void onError(int i, String s) { 107 | ShowToast("搜索失败"); 108 | } 109 | }); 110 | 111 | } 112 | }); 113 | 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/MessageSettingActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import android.widget.RelativeLayout; 9 | 10 | import com.clover.R; 11 | 12 | 13 | public class MessageSettingActivity extends BaseActivity { 14 | 15 | private RelativeLayout rv_voice;//声音 16 | private RelativeLayout rv_shake;//振动 17 | private ImageView iv_openvoice;//开启声音 18 | private ImageView iv_closevoice;//关闭声音 19 | private ImageView iv_openshake;//开启振动 20 | private ImageView iv_closeshake;//关闭振动 21 | SharedPreferences sharedPreferences; 22 | SharedPreferences.Editor editor; 23 | //SharePreferenceUtil mSharedUtil; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_message_setting); 29 | 30 | sharedPreferences = getSharedPreferences("set", MODE_PRIVATE); 31 | editor = sharedPreferences.edit(); 32 | 33 | initToolbar(getResources().getString(R.string.title_activity_message_setting),new Intent(this, SettingActivity.class), this); 34 | //mSharedUtil = application.getSpUtil(); 35 | 36 | rv_voice = (RelativeLayout)findViewById(R.id.switch_voice); 37 | rv_shake = (RelativeLayout)findViewById(R.id.switch_shake); 38 | iv_openvoice = (ImageView)findViewById(R.id.openvoice); 39 | iv_closevoice = (ImageView)findViewById(R.id.closevoice); 40 | iv_openshake = (ImageView)findViewById(R.id.openshake); 41 | iv_closeshake = (ImageView)findViewById(R.id.closeshake); 42 | if (sharedPreferences.getInt("voice", 0) == 1) { 43 | iv_openvoice.setVisibility(View.VISIBLE); 44 | iv_closevoice.setVisibility(View.INVISIBLE); 45 | }else{ 46 | iv_openvoice.setVisibility(View.INVISIBLE); 47 | iv_closevoice.setVisibility(View.VISIBLE); 48 | } 49 | 50 | if (sharedPreferences.getInt("shake", 0) == 1) { 51 | iv_openshake.setVisibility(View.VISIBLE); 52 | iv_closeshake.setVisibility(View.INVISIBLE); 53 | }else{ 54 | iv_openshake.setVisibility(View.INVISIBLE); 55 | iv_closeshake.setVisibility(View.VISIBLE); 56 | } 57 | 58 | 59 | rv_voice.setOnClickListener(new View.OnClickListener() { 60 | @Override 61 | public void onClick(View v) { 62 | if(iv_openvoice.getVisibility() == View.VISIBLE) { 63 | iv_openvoice.setVisibility(View.INVISIBLE); 64 | iv_closevoice.setVisibility(View.VISIBLE); 65 | //mSharedUtil.setAllowVoiceEnable(false); 66 | editor.putInt("voice",0); 67 | }else if(iv_closevoice.getVisibility() == View.VISIBLE){ 68 | iv_closevoice.setVisibility(View.INVISIBLE); 69 | iv_openvoice.setVisibility(View.VISIBLE); 70 | //mSharedUtil.setAllowVoiceEnable(true); 71 | editor.putInt("voice",1); 72 | } 73 | editor.commit(); 74 | } 75 | }); 76 | 77 | rv_shake.setOnClickListener(new View.OnClickListener() { 78 | @Override 79 | public void onClick(View v) { 80 | if(iv_openshake.getVisibility() == View.VISIBLE) { 81 | iv_openshake.setVisibility(View.INVISIBLE); 82 | iv_closeshake.setVisibility(View.VISIBLE); 83 | //mSharedUtil.setAllowVibrateEnable(false); 84 | editor.putInt("shake",0); 85 | }else if(iv_closeshake.getVisibility() == View.VISIBLE){ 86 | iv_closeshake.setVisibility(View.INVISIBLE); 87 | iv_openshake.setVisibility(View.VISIBLE); 88 | //mSharedUtil.setAllowVibrateEnable(true); 89 | editor.putInt("shake",1); 90 | } 91 | editor.commit(); 92 | } 93 | }); 94 | 95 | } 96 | 97 | 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/SettingActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.RelativeLayout; 7 | 8 | import com.clover.R; 9 | 10 | 11 | public class SettingActivity extends BaseActivity { 12 | 13 | private RelativeLayout rv_changepassword;//修改密码 14 | private RelativeLayout rv_messagesetting;//消息通知的设置 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_setting); 20 | 21 | initToolbar(getResources().getString(R.string.title_activity_setting),new Intent(this, MainActivity.class), this); 22 | 23 | rv_changepassword = (RelativeLayout)findViewById(R.id.layout_changepassword); 24 | rv_messagesetting = (RelativeLayout)findViewById(R.id.layout_messagesetting); 25 | 26 | rv_changepassword.setOnClickListener(new View.OnClickListener() { 27 | @Override 28 | public void onClick(View v) { 29 | Intent intent = new Intent(SettingActivity.this, ChangePasswordActivity.class); 30 | startActivity(intent); 31 | } 32 | }); 33 | 34 | rv_messagesetting.setOnClickListener(new View.OnClickListener() { 35 | @Override 36 | public void onClick(View v) { 37 | Intent intent = new Intent(SettingActivity.this, MessageSettingActivity.class); 38 | startActivity(intent); 39 | } 40 | }); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/SpaceActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.clover.R; 10 | import com.clover.adapter.MdListViewAdapter; 11 | import com.clover.entities.Mood; 12 | import com.clover.entities.User; 13 | import com.clover.view.XListView; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | import cn.bmob.im.bean.BmobChatUser; 19 | import cn.bmob.v3.BmobQuery; 20 | import cn.bmob.v3.listener.FindListener; 21 | 22 | 23 | public class SpaceActivity extends BaseActivity implements XListView.IXListViewListener{ 24 | private MdListViewAdapter mdListViewAdapter; 25 | private XListView mdListView; 26 | private List mdListData; 27 | private ImageView iv; 28 | private Handler mHandler; 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | setContentView(R.layout.activity_space); 34 | initView(); 35 | initData(false); 36 | 37 | } 38 | 39 | private void initView(){ 40 | initToolbar("空间",new Intent(this, MainActivity.class), this); 41 | 42 | mdListView = (XListView) findViewById(R.id.lv_mood); 43 | mdListView.setXListViewListener(this); 44 | iv = (ImageView) findViewById(R.id.iv_add); 45 | iv.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View v) { 48 | Intent intent = new Intent(SpaceActivity.this, AddMoodActivity.class); 49 | startActivity(intent); 50 | } 51 | }); 52 | mHandler = new Handler(); 53 | 54 | } 55 | 56 | private void initData(boolean isRefresh){ 57 | BmobQuery eq1 = new BmobQuery<>(); 58 | eq1.addWhereEqualTo("belongId", BmobChatUser.getCurrentUser(this, User.class).getObjectId()); 59 | BmobQuery eq2 = new BmobQuery(); 60 | eq2.addWhereEqualTo("belongId", application.getOne_user().getObjectId()); 61 | List> queries = new ArrayList>(); 62 | queries.add(eq1); 63 | queries.add(eq2); 64 | BmobQuery mainQuery = new BmobQuery<>(); 65 | mainQuery.or(queries); 66 | if(isRefresh){ 67 | mainQuery.setCachePolicy(BmobQuery.CachePolicy.NETWORK_ONLY); 68 | }else { 69 | mainQuery.setCachePolicy(BmobQuery.CachePolicy.CACHE_THEN_NETWORK); 70 | } 71 | 72 | mainQuery.findObjects(this, new FindListener() { 73 | @Override 74 | public void onSuccess(List object) { 75 | if(object.size()>0){ 76 | mdListData = object; 77 | ShowLog("查询成功"); 78 | mdListViewAdapter = new MdListViewAdapter(SpaceActivity.this, mdListData); 79 | mdListView.setAdapter(mdListViewAdapter); 80 | } 81 | 82 | } 83 | @Override 84 | public void onError(int code, String msg) { 85 | ShowLog("查询失败"); 86 | } 87 | }); 88 | 89 | } 90 | private void onLoad() { 91 | mdListView.stopRefresh(); 92 | mdListView.setRefreshTime("刚刚"); 93 | } 94 | 95 | @Override 96 | public void onRefresh() { 97 | mHandler.postDelayed(new Runnable() { 98 | @Override 99 | public void run() { 100 | //start = ++refreshCnt; 101 | mdListData.clear(); 102 | initData(true); 103 | // mAdapter.notifyDataSetChanged(); 104 | mdListViewAdapter = new MdListViewAdapter(SpaceActivity.this, mdListData); 105 | mdListView.setAdapter(mdListViewAdapter); 106 | onLoad(); 107 | } 108 | }, 2000); 109 | } 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/TTTAActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.os.Bundle; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.Toast; 11 | 12 | import com.clover.R; 13 | import com.clover.net.BmobRequest; 14 | 15 | 16 | 17 | public class TTTAActivity extends BaseActivity { 18 | 19 | String GAME_START_ACTION = "GAME_START"; 20 | private Button btn_Start_TwoPeople; 21 | String msg; 22 | 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_ttta); 28 | initToolbar(getResources().getString(R.string.Game_Title_Tictactoe),new Intent(this, MainActivity.class), this); 29 | btn_Start_TwoPeople = (Button)findViewById(R.id.btn_start_two); 30 | 31 | 32 | btn_Start_TwoPeople.setOnClickListener(new View.OnClickListener() { 33 | @Override 34 | public void onClick(View v) { 35 | msg = "GAME_INVITE"; 36 | Toast.makeText(getApplicationContext(),R.string.TTTActivity_Game_InviteMsg, 37 | Toast.LENGTH_SHORT).show(); 38 | BmobRequest.pushMessageToLover(msg, "GAME_INVITE", TTTAActivity.this,application.getOne_user().getObjectId(), application.getOne_user(), chatManager); 39 | btn_Start_TwoPeople.setEnabled(false); 40 | } 41 | }); 42 | 43 | registerBoradcastReceiver(); 44 | } 45 | 46 | private BroadcastReceiver gameStartReceiver = new BroadcastReceiver() { 47 | @Override 48 | public void onReceive(Context context, final Intent intent) { 49 | String action = intent.getAction(); 50 | int extra = intent.getExtras().getInt("key"); 51 | switch (extra) { 52 | case 1: 53 | 54 | break; 55 | case 2: 56 | Toast.makeText( 57 | getApplicationContext(),R.string.TTTA_Game_Invited, 58 | Toast.LENGTH_SHORT).show(); 59 | 60 | Intent intent2 = new Intent(TTTAActivity.this, TTTATPActivity.class); 61 | 62 | startActivity(intent2); 63 | 64 | } 65 | abortBroadcast(); 66 | } 67 | }; 68 | 69 | public void registerBoradcastReceiver(){ 70 | IntentFilter myIntentFilter = new IntentFilter(); 71 | myIntentFilter.addAction(GAME_START_ACTION); 72 | //注册广播 73 | registerReceiver(gameStartReceiver, myIntentFilter); 74 | } 75 | 76 | public void startTwoPeople(View v){ 77 | Intent intent = new Intent(this,TTTATPActivity.class); 78 | startActivity(intent); 79 | } 80 | 81 | public void startPlayWithComputer(View v){ 82 | Intent intent = new Intent(this,TTTAPWCActivity.class); 83 | startActivity(intent); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/UpdateUserNickActivity.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.text.TextUtils; 6 | import android.view.Menu; 7 | import android.view.MenuItem; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | import android.widget.Toast; 12 | 13 | import com.clover.R; 14 | import com.clover.entities.User; 15 | 16 | import cn.bmob.v3.listener.UpdateListener; 17 | 18 | public class UpdateUserNickActivity extends BaseActivity { 19 | 20 | private EditText et_nick; 21 | private Button btn_finishNick; 22 | String nick; 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_update_user_nick); 27 | initView(); 28 | } 29 | 30 | private void initView(){ 31 | initToolbar(getResources().getString(R.string.title_activity_update_user_nick),new Intent(this, UserInfoUpdateActivity.class), this); 32 | et_nick = (EditText)findViewById(R.id.updateNick); 33 | btn_finishNick = (Button)findViewById(R.id.finishNick); 34 | 35 | btn_finishNick.setOnClickListener(new View.OnClickListener() { 36 | @Override 37 | public void onClick(View v) { 38 | nick = et_nick.getText().toString(); 39 | if(TextUtils.isEmpty(nick)){ 40 | Toast.makeText(UpdateUserNickActivity.this, R.string.pleaseinputnick, Toast.LENGTH_SHORT).show(); 41 | }else{ 42 | updateNick(nick); 43 | finish(); 44 | } 45 | } 46 | }); 47 | } 48 | 49 | /** 50 | * 修改昵称 51 | */ 52 | private void updateNick(String nick){ 53 | final User user = userManager.getCurrentUser(User.class); 54 | User u = new User(); 55 | u.setNick(nick); 56 | u.setObjectId(user.getObjectId()); 57 | u.update(this, new UpdateListener() { 58 | @Override 59 | public void onSuccess() { 60 | Toast.makeText(UpdateUserNickActivity.this, R.string.updatesuccess, Toast.LENGTH_SHORT).show(); 61 | } 62 | 63 | @Override 64 | public void onFailure(int i, String s) { 65 | Toast.makeText(UpdateUserNickActivity.this,R.string.updatefailure, Toast.LENGTH_SHORT).show(); 66 | } 67 | }); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/ui/frgms/GamePage.java: -------------------------------------------------------------------------------- 1 | package com.clover.ui.frgms; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.View.OnClickListener; 10 | import android.view.ViewGroup; 11 | import android.widget.Button; 12 | 13 | import com.clover.R; 14 | import com.clover.ui.TSwapActivity; 15 | import com.clover.ui.TTTAActivity; 16 | import com.clover.ui.TZFEActivity; 17 | 18 | 19 | public class GamePage extends Fragment implements OnClickListener{ 20 | 21 | private Activity activity; 22 | private Button btn_ticTacToe; 23 | private Button btn_my2048; 24 | private Button btn_swapGame; 25 | 26 | @Override 27 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 28 | Bundle savedInstanceState) { 29 | 30 | View view = inflater.inflate(R.layout.fragment_game_page,container,false); 31 | initView(view); 32 | return view; 33 | } 34 | 35 | private void initView(View view){ 36 | activity = getActivity(); 37 | btn_ticTacToe = (Button) view.findViewById(R.id.ticTacToe); 38 | btn_my2048 = (Button) view.findViewById(R.id.my2048); 39 | btn_swapGame = (Button) view.findViewById(R.id.swapGame); 40 | 41 | 42 | btn_ticTacToe.setOnClickListener(this); 43 | btn_my2048.setOnClickListener(this); 44 | btn_swapGame.setOnClickListener(this); 45 | 46 | } 47 | 48 | @Override 49 | public void onClick(View v) { 50 | Intent intent; 51 | switch (v.getId()){ 52 | case R.id.ticTacToe: 53 | intent = new Intent(activity,TTTAActivity.class); 54 | startActivity(intent); 55 | break; 56 | case R.id.my2048: 57 | intent = new Intent(activity,TZFEActivity.class); 58 | startActivity(intent); 59 | break; 60 | case R.id.swapGame: 61 | intent = new Intent(activity,TSwapActivity.class); 62 | startActivity(intent); 63 | break; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/ActivityCollector.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | import android.app.Activity; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * Created by dan on 2015/7/6. 10 | */ 11 | public class ActivityCollector { 12 | public static List activities = new ArrayList(); 13 | 14 | public static void addActivity(Activity activity){ 15 | activities.add(activity); 16 | } 17 | 18 | public static void removeActivity(Activity activity){ 19 | activities.remove(activity); 20 | } 21 | 22 | public static void finishAll(){ 23 | for(Activity activity : activities){ 24 | if(!activity.isFinishing()){ 25 | activity.finish(); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/CloverApplication.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.clover.entities.Relationship; 7 | import com.clover.entities.User; 8 | import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache; 9 | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; 10 | import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache; 11 | import com.nostra13.universalimageloader.core.ImageLoader; 12 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; 13 | import com.nostra13.universalimageloader.core.assist.QueueProcessingType; 14 | import com.nostra13.universalimageloader.utils.StorageUtils; 15 | 16 | import java.io.File; 17 | 18 | 19 | /** 20 | * Created by zpfang on 2015/6/30. 21 | */ 22 | public class CloverApplication extends Application{ 23 | 24 | public static CloverApplication application; 25 | private User one_user; 26 | private Relationship relationship; 27 | 28 | @Override 29 | public void onCreate() { 30 | // TODO Auto-generated method stub 31 | super.onCreate(); 32 | // 是否开启debug模式--默认开启状态 33 | //BmobChat.DEBUG_MODE = true; 34 | application = this; 35 | initImageLoader(getApplicationContext()); 36 | } 37 | 38 | public User getOne_user() { 39 | return one_user; 40 | } 41 | 42 | public void setOne_user(User one_user) { 43 | this.one_user = one_user; 44 | } 45 | 46 | public Relationship getRelationship() { 47 | return relationship; 48 | } 49 | 50 | public void setRelationship(Relationship relationship) { 51 | this.relationship = relationship; 52 | } 53 | 54 | /** 初始化ImageLoader */ 55 | public static void initImageLoader(Context context) { 56 | File cacheDir = StorageUtils.getOwnCacheDirectory(context, 57 | "bmobim/Cache");// 获取到缓存的目录地址 58 | // 创建配置ImageLoader,这个可以设定在APPLACATION里面,设置为全局的配置参数 59 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder( 60 | context) 61 | // 线程池内加载的数量 62 | .threadPoolSize(3).threadPriority(Thread.NORM_PRIORITY - 2) 63 | .memoryCache(new WeakMemoryCache()) 64 | .denyCacheImageMultipleSizesInMemory() 65 | .discCacheFileNameGenerator(new Md5FileNameGenerator()) 66 | // 将保存的时候的URI名称用MD5 加密 67 | .tasksProcessingOrder(QueueProcessingType.LIFO) 68 | .discCache(new UnlimitedDiscCache(cacheDir))// 自定义缓存路径 69 | // .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) 70 | .writeDebugLogs() // Remove for release app 71 | .build(); 72 | // Initialize ImageLoader with configuration. 73 | ImageLoader.getInstance().init(config);// 全局初始化此配置 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/CommonUtils.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | 7 | public class CommonUtils { 8 | 9 | /** 检查是否有网络 */ 10 | public static boolean isNetworkAvailable(Context context) { 11 | NetworkInfo info = getNetworkInfo(context); 12 | if (info != null) { 13 | return info.isAvailable(); 14 | } 15 | return false; 16 | } 17 | 18 | /** 检查是否是WIFI */ 19 | public static boolean isWifi(Context context) { 20 | NetworkInfo info = getNetworkInfo(context); 21 | if (info != null) { 22 | if (info.getType() == ConnectivityManager.TYPE_WIFI) 23 | return true; 24 | } 25 | return false; 26 | } 27 | 28 | /** 检查是否是移动网络 */ 29 | public static boolean isMobile(Context context) { 30 | NetworkInfo info = getNetworkInfo(context); 31 | if (info != null) { 32 | if (info.getType() == ConnectivityManager.TYPE_MOBILE) 33 | return true; 34 | } 35 | return false; 36 | } 37 | 38 | private static NetworkInfo getNetworkInfo(Context context) { 39 | 40 | ConnectivityManager cm = (ConnectivityManager) context 41 | .getSystemService(Context.CONNECTIVITY_SERVICE); 42 | return cm.getActiveNetworkInfo(); 43 | } 44 | 45 | /** 检查SD卡是否存在 */ 46 | public static boolean checkSdCard() { 47 | if (android.os.Environment.getExternalStorageState().equals( 48 | android.os.Environment.MEDIA_MOUNTED)) 49 | return true; 50 | else 51 | return false; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/Config.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | /** 4 | * Created by dan on 2015/7/2. 5 | */ 6 | public class Config { 7 | public static String SLEEP_ACTION = "SLEEP_ACTION"; 8 | public static String MENSES_COME_ACTION = "MENSES_COME"; 9 | public static String DISEASE_COME_ACTION = "DISEASE_COME"; 10 | public static String GAME_BUTTON_ACTION = "GAME_BUTTON"; 11 | public static String GAME_START_ACTION = "GAME_START"; 12 | /** 13 | * 我的头像保存目录 14 | */ 15 | public static String MyAvatarDir = "/sdcard/bmobimdemo/avatar/"; 16 | /** 17 | * 拍照 18 | */ 19 | public static final int NONE = 0; 20 | public static final int PHOTO_GRAPH = 1;// 拍照 21 | public static final int PHOTO_ZOOM = 2; // 缩放 22 | public static final int PHOTO_RESOULT = 3;// 结果 23 | public static final String IMAGE_UNSPECIFIED = "image/*"; 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/MyDatabase.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteDatabase.CursorFactory; 6 | import android.database.sqlite.SQLiteOpenHelper; 7 | 8 | /** 9 | * Created by YUSHAN on 2015/7/2. 10 | */ 11 | public class MyDatabase extends SQLiteOpenHelper { 12 | 13 | public MyDatabase(Context context, String name, CursorFactory factory, 14 | int version) { 15 | super(context, name, factory, version); 16 | // TODO 自动生成的构造函数存根 17 | } 18 | 19 | 20 | @Override 21 | public void onCreate(SQLiteDatabase db) { 22 | String sql = "create table if not exists myrecord(bestscore int)"; 23 | db.execSQL(sql); 24 | } 25 | 26 | @Override 27 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 28 | // TODO 自动生成的方法存根 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/utils/PhotoUtils.java: -------------------------------------------------------------------------------- 1 | package com.clover.utils; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Bitmap; 5 | import android.net.Uri; 6 | 7 | import java.io.File; 8 | import java.io.FileNotFoundException; 9 | import java.io.FileOutputStream; 10 | import java.io.IOException; 11 | 12 | /** 13 | * Created by dan on 2015/7/6. 14 | */ 15 | public class PhotoUtils { 16 | 17 | /** 18 | * 保存图片 19 | */ 20 | public static void saveBitmap(String dirpath, String filename, 21 | Bitmap bitmap, boolean isDelete) { 22 | File dir = new File(dirpath); 23 | if (!dir.exists()) { 24 | dir.mkdirs(); 25 | } 26 | 27 | File file = new File(dirpath, filename); 28 | // 若存在即删除-默认只保留一张 29 | if (isDelete) { 30 | if (file.exists()) { 31 | file.delete(); 32 | } 33 | } 34 | 35 | if (!file.exists()) { 36 | try { 37 | file.createNewFile(); 38 | } catch (IOException e) { 39 | // TODO Auto-generated catch block 40 | e.printStackTrace(); 41 | } 42 | } 43 | FileOutputStream out = null; 44 | try { 45 | out = new FileOutputStream(file); 46 | if (bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)) { 47 | out.flush(); 48 | } 49 | } catch (FileNotFoundException e) { 50 | e.printStackTrace(); 51 | } catch (IOException e) { 52 | e.printStackTrace(); 53 | } finally { 54 | if (out != null) { 55 | try { 56 | out.close(); 57 | } catch (IOException e) { 58 | e.printStackTrace(); 59 | } 60 | } 61 | } 62 | } 63 | 64 | public static Intent startPhotoZoom(Uri uri) { 65 | Intent intent = new Intent("com.android.camera.action.CROP"); 66 | intent.setDataAndType(uri, Config.IMAGE_UNSPECIFIED); 67 | intent.putExtra("crop", "true"); 68 | // aspectX aspectY 是宽高的比例 69 | intent.putExtra("aspectX", 1); 70 | intent.putExtra("aspectY", 1); 71 | // outputX outputY 是裁剪图片宽高 72 | intent.putExtra("outputX",500); 73 | intent.putExtra("outputY", 500); 74 | intent.putExtra("return-data", true); 75 | return intent; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/clover/view/XListViewHeader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @file XListViewHeader.java 3 | * @create Apr 18, 2012 5:22:27 PM 4 | * @author Maxwin 5 | * @description XListView's header 6 | */ 7 | package com.clover.view; 8 | 9 | import com.clover.R; 10 | import android.content.Context; 11 | import android.util.AttributeSet; 12 | import android.view.Gravity; 13 | import android.view.LayoutInflater; 14 | import android.view.View; 15 | import android.view.animation.Animation; 16 | import android.view.animation.RotateAnimation; 17 | import android.widget.ImageView; 18 | import android.widget.LinearLayout; 19 | import android.widget.ProgressBar; 20 | import android.widget.TextView; 21 | 22 | public class XListViewHeader extends LinearLayout { 23 | private LinearLayout mContainer; 24 | private ImageView mArrowImageView; 25 | private ProgressBar mProgressBar; 26 | private TextView mHintTextView; 27 | private int mState = STATE_NORMAL; 28 | 29 | private Animation mRotateUpAnim; 30 | private Animation mRotateDownAnim; 31 | 32 | private final int ROTATE_ANIM_DURATION = 180; 33 | 34 | public final static int STATE_NORMAL = 0; 35 | public final static int STATE_READY = 1; 36 | public final static int STATE_REFRESHING = 2; 37 | 38 | public XListViewHeader(Context context) { 39 | super(context); 40 | initView(context); 41 | } 42 | 43 | /** 44 | * @param context 45 | * @param attrs 46 | */ 47 | public XListViewHeader(Context context, AttributeSet attrs) { 48 | super(context, attrs); 49 | initView(context); 50 | } 51 | 52 | private void initView(Context context) { 53 | // 初始情况,设置下拉刷新view高度为0 54 | LayoutParams lp = new LayoutParams( 55 | LayoutParams.FILL_PARENT, 0); 56 | mContainer = (LinearLayout) LayoutInflater.from(context).inflate( 57 | R.layout.xlistview_header, null); 58 | addView(mContainer, lp); 59 | setGravity(Gravity.BOTTOM); 60 | 61 | mArrowImageView = (ImageView)findViewById(R.id.xlistview_header_arrow); 62 | mHintTextView = (TextView)findViewById(R.id.xlistview_header_hint_textview); 63 | mProgressBar = (ProgressBar)findViewById(R.id.xlistview_header_progressbar); 64 | 65 | mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, 66 | Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 67 | 0.5f); 68 | mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION); 69 | mRotateUpAnim.setFillAfter(true); 70 | mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f, 71 | Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 72 | 0.5f); 73 | mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION); 74 | mRotateDownAnim.setFillAfter(true); 75 | } 76 | 77 | public void setState(int state) { 78 | if (state == mState) return ; 79 | 80 | if (state == STATE_REFRESHING) { // 显示进度 81 | mArrowImageView.clearAnimation(); 82 | mArrowImageView.setVisibility(View.INVISIBLE); 83 | mProgressBar.setVisibility(View.VISIBLE); 84 | } else { // 显示箭头图片 85 | mArrowImageView.setVisibility(View.VISIBLE); 86 | mProgressBar.setVisibility(View.INVISIBLE); 87 | } 88 | 89 | switch(state){ 90 | case STATE_NORMAL: 91 | if (mState == STATE_READY) { 92 | mArrowImageView.startAnimation(mRotateDownAnim); 93 | } 94 | if (mState == STATE_REFRESHING) { 95 | mArrowImageView.clearAnimation(); 96 | } 97 | mHintTextView.setText(R.string.xlistview_header_hint_normal); 98 | break; 99 | case STATE_READY: 100 | if (mState != STATE_READY) { 101 | mArrowImageView.clearAnimation(); 102 | mArrowImageView.startAnimation(mRotateUpAnim); 103 | mHintTextView.setText(R.string.xlistview_header_hint_ready); 104 | } 105 | break; 106 | case STATE_REFRESHING: 107 | mHintTextView.setText(R.string.xlistview_header_hint_loading); 108 | break; 109 | default: 110 | } 111 | 112 | mState = state; 113 | } 114 | 115 | public void setVisiableHeight(int height) { 116 | if (height < 0) 117 | height = 0; 118 | LayoutParams lp = (LayoutParams) mContainer 119 | .getLayoutParams(); 120 | lp.height = height; 121 | mContainer.setLayoutParams(lp); 122 | } 123 | 124 | public int getVisiableHeight() { 125 | return mContainer.getHeight(); 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /app/src/main/res/anim/scaleanim.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/a.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_bottom_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/about_bottom_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_mid_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/about_mid_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/about_top_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/about_top_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/add_mood_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/anniversary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/anniversary.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/anniversary_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/anniversary_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/apologize.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/apologize.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/base_edit_input.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/base_edit_input.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/base_horization_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/base_horization_line.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/base_horizontal_line.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/base_horizontal_line.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/begin.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/begin.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/best.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/best.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/blank9.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/blank9.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/blank_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/blank_9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/bomb.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/boring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/boring.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_ann_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_health_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_n.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/btn_login_n.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_p.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/btn_login_p.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_logout_n.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/btn_logout_n.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_logout_p.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/btn_logout_p.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_logout_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p10_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p11_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p12_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p1_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p2_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p3_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p4_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p5_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p6_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p7_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p8_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_p9_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatfrom_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatfrom_bg_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatfrom_bg_focused.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatfrom_bg_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatfrom_bg_normal.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatfrom_bg_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatfrom_bg_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatto_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatto_bg_focused.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatto_bg_focused.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatto_bg_normal.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatto_bg_normal.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/chatto_bg_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/chatto_bg_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/day.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/doing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/doing.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/head.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/health.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/health_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/health_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/hug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/hug.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/input_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iv_back_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/kiss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/kiss.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/layout_bg1.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/layout_bg1.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/main_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/miao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/miao.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/miss.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/miss.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/newgame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/newgame.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/newscore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/newscore.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p10.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p10_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p10_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p11.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p11_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p11_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p12.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p12_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p12_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p1_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p1_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p2_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p2_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p3_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p3_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p4_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p4_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p5_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p5_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p6.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p6_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p6_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p7.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p7_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p7_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p8.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p8_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p8_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/p9_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/p9_r.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo0.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo1024.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo128.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo16.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo204.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo204.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo2048.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo256.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo512.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/photo8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/photo8.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pop_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/pop_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/pop_bg_press.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/pop_bg_press.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/register_bottom_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/register_bottom_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/set.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/set.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/testgif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/testgif.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable/tv_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/wang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/wang.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/xlistview_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hysunny/Clover/13703ae0d443c1f3d6c458621251774e12964de8/app/src/main/res/drawable/xlistview_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about_us.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 14 | 15 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_mood.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 21 | 29 | 35 | 36 | 37 |