Commit 6acb5abe authored by fallenstardust's avatar fallenstardust

识别剪贴板特定文字直接加房

parent ea3a6777
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 32010523 versionCode 32010524
versionName "3.2.1" versionName "3.2.1"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
......
...@@ -20,6 +20,7 @@ import java.util.zip.ZipFile; ...@@ -20,6 +20,7 @@ import java.util.zip.ZipFile;
import cn.garymb.ygomobile.AppsSettings; import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.Constants; import cn.garymb.ygomobile.Constants;
import cn.garymb.ygomobile.lite.R; import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.loader.CardLoader; import cn.garymb.ygomobile.loader.CardLoader;
import cn.garymb.ygomobile.ui.activities.BaseActivity; import cn.garymb.ygomobile.ui.activities.BaseActivity;
......
...@@ -9,6 +9,13 @@ import android.widget.*; ...@@ -9,6 +9,13 @@ import android.widget.*;
import java.util.*; import java.util.*;
import android.support.v7.widget.*; import android.support.v7.widget.*;
import cn.garymb.ygodata.YGOGameOptions;
import cn.garymb.ygomobile.YGOStarter;
import cn.garymb.ygomobile.bean.ServerInfo;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.adapters.ServerListAdapter;
public class ServiceDuelAssistant extends Service public class ServiceDuelAssistant extends Service
{ {
private LinearLayout mFloatLayout; private LinearLayout mFloatLayout;
...@@ -87,20 +94,18 @@ public class ServiceDuelAssistant extends Service ...@@ -87,20 +94,18 @@ public class ServiceDuelAssistant extends Service
@Override @Override
public void run() { public void run() {
// TODO Auto-generated method stub
if (isdis) { if (isdis) {
isdis = false; isdis = false;
mWindowManager.removeView(mFloatLayout); mWindowManager.removeView(mFloatLayout);
} }
} }
}, 2000); }, 3000);
ds_qx.setOnClickListener(new OnClickListener(){ ds_qx.setOnClickListener(new OnClickListener(){
@Override @Override
public void onClick(View p1) { public void onClick(View p1) {
disJoinDialog(); disJoinDialog();
// TODO: Implement this method
} }
}); });
ds_join.setOnClickListener(new OnClickListener(){ ds_join.setOnClickListener(new OnClickListener(){
...@@ -111,14 +116,24 @@ public class ServiceDuelAssistant extends Service ...@@ -111,14 +116,24 @@ public class ServiceDuelAssistant extends Service
isdis = false; isdis = false;
mWindowManager.removeView(mFloatLayout); mWindowManager.removeView(mFloatLayout);
} }
IntentUtil.duelIntent(ServiceDuelAssistant.this, SharedPreferenceUtil.getDuelIp(), SharedPreferenceUtil.getDuelPort(), SharedPreferenceUtil.getDuelName(), password); ServerInfo serverInfo=new ServerListAdapter(ServiceDuelAssistant.this).getItem(0);
// TODO: Implement this method
duelIntent(ServiceDuelAssistant.this,serverInfo.getServerAddr(),serverInfo.getPort(),serverInfo.getPlayerName(),password);
} }
}); });
}
//决斗跳转
// TODO: Implement this method public static void duelIntent(Context context,String ip, int dk, String name, String password){
Intent intent1=new Intent("ygomobile.intent.action.GAME");
intent1.putExtra("host", ip);
intent1.putExtra("port", dk);
intent1.putExtra("user", name);
intent1.putExtra("room", password);
intent1.setPackage("cn.garymb.ygomobile");
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent1);
} }
private void disJoinDialog() { private void disJoinDialog() {
......
...@@ -6,15 +6,6 @@ ...@@ -6,15 +6,6 @@
android:orientation="vertical" android:orientation="vertical"
android:background="#00000000"> android:background="#00000000">
<android.support.v7.widget.CardView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="@dimen/dialog_corner_radius"
app:elevation="15dp"
app:cardBackgroundColor="@color/colorDialogBackground"
android:layout_margin="10dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -39,7 +30,7 @@ ...@@ -39,7 +30,7 @@
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="加入" android:text="@string/join_game"
android:layout_weight="1" android:layout_weight="1"
android:id="@+id/ds_join"/> android:id="@+id/ds_join"/>
...@@ -48,7 +39,7 @@ ...@@ -48,7 +39,7 @@
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="关闭" android:text="@string/search_close"
android:layout_weight="1" android:layout_weight="1"
android:id="@+id/ds_qx"/> android:id="@+id/ds_qx"/>
...@@ -56,7 +47,5 @@ ...@@ -56,7 +47,5 @@
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout> </LinearLayout>
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