Commit 6acb5abe authored by fallenstardust's avatar fallenstardust

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

parent ea3a6777
......@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile"
minSdkVersion 16
targetSdkVersion 22
versionCode 32010523
versionCode 32010524
versionName "3.2.1"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
......
......@@ -20,6 +20,7 @@ import java.util.zip.ZipFile;
import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.Constants;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.loader.CardLoader;
import cn.garymb.ygomobile.ui.activities.BaseActivity;
......
......@@ -9,6 +9,13 @@ import android.widget.*;
import java.util.*;
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
{
private LinearLayout mFloatLayout;
......@@ -87,20 +94,18 @@ public class ServiceDuelAssistant extends Service
@Override
public void run() {
// TODO Auto-generated method stub
if (isdis) {
isdis = false;
mWindowManager.removeView(mFloatLayout);
}
}
}, 2000);
}, 3000);
ds_qx.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View p1) {
disJoinDialog();
// TODO: Implement this method
}
});
ds_join.setOnClickListener(new OnClickListener(){
......@@ -111,14 +116,24 @@ public class ServiceDuelAssistant extends Service
isdis = false;
mWindowManager.removeView(mFloatLayout);
}
IntentUtil.duelIntent(ServiceDuelAssistant.this, SharedPreferenceUtil.getDuelIp(), SharedPreferenceUtil.getDuelPort(), SharedPreferenceUtil.getDuelName(), password);
// TODO: Implement this method
ServerInfo serverInfo=new ServerListAdapter(ServiceDuelAssistant.this).getItem(0);
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() {
......
......@@ -6,15 +6,6 @@
android:orientation="vertical"
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
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -39,7 +30,7 @@
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="加入"
android:text="@string/join_game"
android:layout_weight="1"
android:id="@+id/ds_join"/>
......@@ -48,7 +39,7 @@
style="?android:attr/buttonBarButtonStyle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="关闭"
android:text="@string/search_close"
android:layout_weight="1"
android:id="@+id/ds_qx"/>
......@@ -56,7 +47,5 @@
</LinearLayout>
</android.support.v7.widget.CardView>
</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