Commit 94a8f8cc authored by fallenstardust's avatar fallenstardust

优化提醒动画UI&修复删除房间对话框无法取消

parent 7221007d
......@@ -16,13 +16,13 @@
<port>233</port>
<keep>true</keep>
</server>
<server>
<!--server>
<player-name>fresh chicken</player-name>
<name>233在线人机练习</name>
<ip>s1.ygo233.com</ip>
<port>9999</port>
<keep>true</keep>
</server>
</server-->
<server>
<player-name>Knight of Hanoi</player-name>
<name>阔以Shi正式卡服</name>
......
......@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile"
minSdkVersion 16
targetSdkVersion 22
versionCode 32010525
versionCode 32010527
versionName "3.2.1"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
......
......@@ -39,7 +39,7 @@ public class ServerListAdapter extends BaseRecyclerAdapterPlus<ServerInfo, Serve
builder.setLeftButtonListener((dlg, s) -> {
getContext().startActivity(new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION));
dlg.dismiss();
});
});
builder.show();
});
if(position==0){
......
......@@ -8,6 +8,8 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerViewItemListener;
import android.view.Gravity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.bumptech.glide.Glide;
......@@ -39,6 +41,7 @@ public abstract class BaseCardsAcitivity extends BaseActivity implements CardLoa
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_deck_cards);
AnimationShake2();
mImageLoader = ImageLoader.get(this);
mDrawerlayout = $(R.id.drawer_layout);
......@@ -137,6 +140,11 @@ public abstract class BaseCardsAcitivity extends BaseActivity implements CardLoa
}
public void AnimationShake2(){
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);//加载动画资源文件
findViewById(R.id.cube2).startAnimation(shake); //给组件播放动画效果
}
protected void hideDrawers() {
if (mDrawerlayout.isDrawerOpen(Gravity.RIGHT)) {
mDrawerlayout.closeDrawer(Gravity.RIGHT);
......
......@@ -5,6 +5,7 @@ import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
......@@ -17,6 +18,8 @@ import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
......@@ -61,6 +64,8 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
private ServerListAdapter mServerListAdapter;
private ServerListManager mServerListManager;
Button JoinQQGroup;
@Override
......@@ -83,15 +88,14 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
//event
EventBus.getDefault().register(this);
initBoomMenuButton($(R.id.bmb));
AnimationShake();
//trpay
TrPay.getInstance(HomeActivity.this).initPaySdk("e1014da420ea4405898c01273d6731b6","YGOMobile");
//autoupadte checking
checkForceUpdateSilent();
//ServiceDuelAssistant
startService(new Intent(this,ServiceDuelAssistant.class));
//shake cube
ObjectAnimator shake = shake($(R.id.cube));
shake.start();
BtnJoinQQGroup();
}
@Override
......@@ -112,7 +116,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
mServerListAdapter.notifyDataSetChanged();
dialog.dismiss();
});
dialogPlus.setCancelable(false);
dialogPlus.setCancelable(true);
dialogPlus.setOnCloseLinster(null);
dialogPlus.show();
} else if (event.join) {
......@@ -375,20 +379,28 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
UpdateHelper.getInstance().autoUpdate(getPackageName(), false, intervalMillis);
}
private static ObjectAnimator shake(View view) {
// 8dp 左右抖动的幅度
int delta = view.getResources().getDimensionPixelOffset(R.dimen.spacing_medium);
PropertyValuesHolder pvhTranslateY = PropertyValuesHolder.ofKeyframe(View.TRANSLATION_Y,
Keyframe.ofFloat(0f, 0),
Keyframe.ofFloat(.10f, -delta),
Keyframe.ofFloat(.26f, delta),
Keyframe.ofFloat(.42f, -delta),
Keyframe.ofFloat(.58f, delta),
Keyframe.ofFloat(.74f, -delta),
Keyframe.ofFloat(.90f, delta),
Keyframe.ofFloat(1f, 0f)
);
return ObjectAnimator.ofPropertyValuesHolder(view, pvhTranslateY).setDuration(500);
public void AnimationShake(){
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);//加载动画资源文件
findViewById(R.id.cube).startAnimation(shake); //给组件播放动画效果
}
public void BtnJoinQQGroup() {
$(R.id.btn_join_qq_group).setOnClickListener((v) -> {
String key ="dRkD2L9QgYiYmQoqJUgkR4QUth9UhuT4";
joinQQGroup(key);
});
}
public boolean joinQQGroup(String key) {
//
Intent intent = new Intent();
intent.setData(Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D" + key));
// 此Flag可根据具体产品需要自定义,如设置,则在加群界面按返回,返回手Q主界面,不设置,按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
try {
startActivity(intent);
return true;
} catch (Exception e) {
// 未安装手Q或安装的版本不支持
return false;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="50" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="0"
android:toYDelta="10"
android:duration="30000"
android:interpolator="@anim/cycle" />
\ No newline at end of file
......@@ -13,6 +13,13 @@
android:background="@drawable/bg3"
tools:openDrawer="left">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
android:orientation="vertical">
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -64,20 +71,21 @@
<com.nightonke.boommenu.BoomMenuButton
android:id="@+id/bmb"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:background="@drawable/buttonfunction"
app:bmb_buttonEnum="textOutsideCircle"
app:bmb_buttonPlaceEnum="buttonPlace_sc_9_1"
app:bmb_dimColor="#90000000"
app:bmb_dimColor="#80000000"
app:bmb_normalColor="@android:color/transparent"
app:bmb_piecePlaceEnum="piecePlace_dot_9_1">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:id="@+id/cube2"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="center"
app:srcCompat="@drawable/bottom_1"/>
app:srcCompat="@drawable/cube" />
</com.nightonke.boommenu.BoomMenuButton>
</LinearLayout>
</FrameLayout>
......
......@@ -8,31 +8,55 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:background="@drawable/bg3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
android:orientation="vertical">
</LinearLayout>
<com.tubb.smrv.SwipeMenuRecyclerView
android:id="@+id/list_server"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"/>
<com.nightonke.boommenu.BoomMenuButton
android:id="@+id/bmb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:background="@drawable/buttonfunction"
app:bmb_buttonEnum="textOutsideCircle"
app:bmb_buttonPlaceEnum="buttonPlace_sc_9_1"
app:bmb_dimColor="#90000000"
app:bmb_normalColor="@android:color/transparent"
app:bmb_piecePlaceEnum="piecePlace_dot_9_1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_gravity="bottom"
android:orientation="horizontal"
android:weightSum="1">
<com.nightonke.boommenu.BoomMenuButton
android:id="@+id/bmb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:background="@drawable/buttonfunction"
app:bmb_buttonEnum="textOutsideCircle"
app:bmb_buttonPlaceEnum="buttonPlace_sc_9_1"
app:bmb_dimColor="#80000000"
app:bmb_normalColor="@android:color/transparent"
app:bmb_piecePlaceEnum="piecePlace_dot_9_1">
<ImageView
android:id="@+id/cube"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
app:srcCompat="@drawable/cube" />
</com.nightonke.boommenu.BoomMenuButton>
<ImageView
android:id="@+id/cube"
android:id="@+id/btn_join_qq_group"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
app:srcCompat="@drawable/cube" />
</com.nightonke.boommenu.BoomMenuButton>
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_gravity="bottom"
android:src="@drawable/joinqqgroup" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -49,5 +49,4 @@
<dimen name="brower_arrow_height">150dp</dimen>
<dimen name="menu_text_size">6dp</dimen>
<dimen name="menu_text_top">-5dp</dimen>
<dimen name="spacing_medium">1dp</dimen>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment