@@ -77,6 +77,7 @@ dependencies {
|
||
| 77 | 77 |
compile 'com.nostra13.universalimageloader:universal-image-loader:latest.integration' |
| 78 | 78 |
compile project(path: ':views') |
| 79 | 79 |
compile 'com.umeng.analytics:analytics:latest.integration' |
| 80 |
+ compile 'hanks.xyz:htextview-library:0.1.5' |
|
| 80 | 81 |
} |
| 81 | 82 |
buildscript {
|
| 82 | 83 |
repositories {
|
@@ -9,11 +9,14 @@ import android.support.v4.app.FragmentManager; |
||
| 9 | 9 |
import android.support.v4.app.FragmentTransaction; |
| 10 | 10 |
import android.text.TextUtils; |
| 11 | 11 |
import android.view.View; |
| 12 |
+import android.view.animation.CycleInterpolator; |
|
| 12 | 13 |
import android.widget.ImageButton; |
| 13 | 14 |
import android.widget.ImageView; |
| 14 | 15 |
import android.widget.TextView; |
| 15 | 16 |
import android.widget.Toast; |
| 16 | 17 |
|
| 18 |
+import com.hanks.htextview.HTextView; |
|
| 19 |
+import com.hanks.htextview.HTextViewType; |
|
| 17 | 20 |
import com.umeng.analytics.MobclickAgent; |
| 18 | 21 |
|
| 19 | 22 |
import java.io.File; |
@@ -39,16 +42,24 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 39 | 42 |
private GroupQRFragment qrFragment; |
| 40 | 43 |
private GroupPhotoFragment photoFragment; |
| 41 | 44 |
private ImageButton cameraBtn; |
| 45 |
+ private HTextView hintTextView; |
|
| 42 | 46 |
private static final int TAKE_PHOTO_REQUEST_CODE = 1; |
| 43 | 47 |
private static final int EXIT_GROUP_CODE = 2; |
| 48 |
+ private boolean isGuideShow; |
|
| 44 | 49 |
|
| 45 | 50 |
@Override |
| 46 | 51 |
protected void onCreate(Bundle savedInstanceState) {
|
| 47 | 52 |
super.onCreate(savedInstanceState); |
| 48 | 53 |
setContentView(R.layout.activity_group); |
| 49 | 54 |
SystemUtils.setImmerseLayout(this, findViewById(R.id.title_layout)); |
| 50 |
- dealIntentBundle(getIntent()); |
|
| 51 | 55 |
TextView title = (TextView) findViewById(R.id.title_bar_middle_txt); |
| 56 |
+ cameraBtn = (ImageButton) findViewById(R.id.floating_btn_camera); |
|
| 57 |
+ cameraBtn.setOnClickListener(this); |
|
| 58 |
+ hintTextView = (HTextView)findViewById(R.id.tv_take_photo_hint); |
|
| 59 |
+ findViewById(R.id.title_bar_back_layout).setOnClickListener(this); |
|
| 60 |
+ findViewById(R.id.title_bar_option_layout).setOnClickListener(this); |
|
| 61 |
+ findViewById(R.id.title_bar_qrcode_layout).setOnClickListener(this); |
|
| 62 |
+ dealIntentBundle(getIntent()); |
|
| 52 | 63 |
title.setText(groupName); |
| 53 | 64 |
ImageView groupAvatar = (ImageView) findViewById(R.id.iv_title_bar_avatar); |
| 54 | 65 |
if (defaultAvatarId >= 0) {
|
@@ -56,12 +67,6 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 56 | 67 |
} else {
|
| 57 | 68 |
groupAvatar.setVisibility(View.GONE); |
| 58 | 69 |
} |
| 59 |
- cameraBtn = (ImageButton) findViewById(R.id.floating_btn_camera); |
|
| 60 |
- cameraBtn.setOnClickListener(this); |
|
| 61 |
- findViewById(R.id.title_bar_back_layout).setOnClickListener(this); |
|
| 62 |
- findViewById(R.id.title_bar_option_layout).setOnClickListener(this); |
|
| 63 |
- findViewById(R.id.title_bar_qrcode_layout).setOnClickListener(this); |
|
| 64 |
- showMask(); |
|
| 65 | 70 |
} |
| 66 | 71 |
|
| 67 | 72 |
private void dealIntentBundle(Intent intent) {
|
@@ -188,6 +193,7 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 188 | 193 |
ft.show(qrFragment); |
| 189 | 194 |
} |
| 190 | 195 |
ft.commitAllowingStateLoss(); |
| 196 |
+ showGuideAnim(); |
|
| 191 | 197 |
} |
| 192 | 198 |
|
| 193 | 199 |
private void showPhotoFragment() {
|
@@ -205,24 +211,24 @@ public class GroupActivity extends BaseActivity implements View.OnClickListener |
||
| 205 | 211 |
ft.commitAllowingStateLoss(); |
| 206 | 212 |
} |
| 207 | 213 |
|
| 208 |
- private void showMask() {
|
|
| 209 |
- cameraBtn.postDelayed(new Runnable() {
|
|
| 214 |
+ |
|
| 215 |
+ public void showGuideAnim(){
|
|
| 216 |
+ if(isGuideShow){
|
|
| 217 |
+ return; |
|
| 218 |
+ } |
|
| 219 |
+ isGuideShow = true; |
|
| 220 |
+ hintTextView.setVisibility(View.VISIBLE); |
|
| 221 |
+ hintTextView.setAnimateType(HTextViewType.TYPER); |
|
| 222 |
+ hintTextView.animateText(getString(R.string.click_to_take_photo)); |
|
| 223 |
+ cameraBtn.animate().translationX(10).scaleX(1.2f).scaleY(1.2f).setInterpolator(new CycleInterpolator(6)).setDuration(2500).start(); |
|
| 224 |
+ hintTextView.postDelayed(new Runnable() {
|
|
| 210 | 225 |
@Override |
| 211 | 226 |
public void run() {
|
| 212 |
- runOnUiThread(new Runnable() {
|
|
| 213 |
- @Override |
|
| 214 |
- public void run() {
|
|
| 215 |
- int left = cameraBtn.getLeft(); |
|
| 216 |
- int right = cameraBtn.getRight(); |
|
| 217 |
- int top = cameraBtn.getTop(); |
|
| 218 |
- int bottom = cameraBtn.getBottom(); |
|
| 219 |
- int loc[] = {left, top, right, bottom};
|
|
| 220 |
- Intent intent = new Intent(GroupActivity.this, TipsActivity.class); |
|
| 221 |
- intent.putExtra("loc", loc);
|
|
| 222 |
- startActivity(intent); |
|
| 223 |
- } |
|
| 224 |
- }); |
|
| 227 |
+ if(hintTextView!=null && hintTextView.isShown()){
|
|
| 228 |
+ hintTextView.setVisibility(View.GONE); |
|
| 229 |
+ } |
|
| 225 | 230 |
} |
| 226 |
- }, 500); |
|
| 231 |
+ },3000); |
|
| 227 | 232 |
} |
| 233 |
+ |
|
| 228 | 234 |
} |
@@ -45,7 +45,7 @@ public class TipsActivity extends Activity {
|
||
| 45 | 45 |
|
| 46 | 46 |
public void clickClose() {
|
| 47 | 47 |
finish(); |
| 48 |
- overridePendingTransition(0, 0); //取消动画效果 |
|
| 48 |
+ overridePendingTransition(0, 0); |
|
| 49 | 49 |
} |
| 50 | 50 |
|
| 51 | 51 |
@Override |
@@ -1,5 +1,6 @@ |
||
| 1 | 1 |
package ai.pai.client.fragments; |
| 2 | 2 |
|
| 3 |
+import android.app.Activity; |
|
| 3 | 4 |
import android.content.ComponentName; |
| 4 | 5 |
import android.content.Context; |
| 5 | 6 |
import android.content.Intent; |
@@ -21,6 +22,7 @@ import com.android.common.utils.LogHelper; |
||
| 21 | 22 |
import java.util.ArrayList; |
| 22 | 23 |
|
| 23 | 24 |
import ai.pai.client.R; |
| 25 |
+import ai.pai.client.activity.GroupActivity; |
|
| 24 | 26 |
import ai.pai.client.adapter.PhotoStaggeredAdapter; |
| 25 | 27 |
import ai.pai.client.beans.GroupPhotoItem; |
| 26 | 28 |
import ai.pai.client.db.DBService; |
@@ -142,6 +144,12 @@ public class GroupPhotoFragment extends BaseFragment implements GroupService.Gr |
||
| 142 | 144 |
adapter.addGroupPhotoItems(photoItems); |
| 143 | 145 |
} |
| 144 | 146 |
noPhotoLayout.setVisibility(adapter.getPhotoList().size()==0 ? View.VISIBLE : View.GONE); |
| 147 |
+ if(isAdded()){
|
|
| 148 |
+ if(getActivity() instanceof GroupActivity){
|
|
| 149 |
+ GroupActivity groupActivity = (GroupActivity)getActivity(); |
|
| 150 |
+ groupActivity.showGuideAnim(); |
|
| 151 |
+ } |
|
| 152 |
+ } |
|
| 145 | 153 |
break; |
| 146 | 154 |
case GroupService.GroupCommand.COMMAND_REFRESH_PHOTOS: |
| 147 | 155 |
ArrayList<GroupPhotoItem> photos = (ArrayList<GroupPhotoItem>)response; |
@@ -3,6 +3,7 @@ |
||
| 3 | 3 |
android:layout_width="match_parent" |
| 4 | 4 |
android:layout_height="match_parent" |
| 5 | 5 |
xmlns:app="http://schemas.android.com/apk/res-auto" |
| 6 |
+ xmlns:htext="http://schemas.android.com/tools" |
|
| 6 | 7 |
android:background="@color/white"> |
| 7 | 8 |
|
| 8 | 9 |
<RelativeLayout |
@@ -112,4 +113,16 @@ |
||
| 112 | 113 |
android:layout_margin="10dp" |
| 113 | 114 |
android:background="@drawable/floating_camera_selector" /> |
| 114 | 115 |
|
| 116 |
+ <com.hanks.htextview.HTextView |
|
| 117 |
+ android:id="@+id/tv_take_photo_hint" |
|
| 118 |
+ android:layout_width="wrap_content" |
|
| 119 |
+ android:layout_height="56dp" |
|
| 120 |
+ android:gravity="center" |
|
| 121 |
+ android:text="@string/click_to_take_photo" |
|
| 122 |
+ android:layout_toLeftOf="@id/floating_btn_camera" |
|
| 123 |
+ android:layout_alignTop="@id/floating_btn_camera" |
|
| 124 |
+ htext:animateType="typer" |
|
| 125 |
+ android:visibility="gone" |
|
| 126 |
+ android:textSize="17sp"/> |
|
| 127 |
+ |
|
| 115 | 128 |
</RelativeLayout> |
@@ -250,4 +250,6 @@ |
||
| 250 | 250 |
<string name="group_photo_not_null">该群里已有照片,无法删除</string> |
| 251 | 251 |
|
| 252 | 252 |
<string name="group_admin_not_me">您不是该群的管理员,无法删除</string> |
| 253 |
+ |
|
| 254 |
+ <string name="click_to_take_photo">点我拍照,记录您的精彩瞬间吧</string> |
|
| 253 | 255 |
</resources> |