|
@@ -12,15 +12,12 @@ import android.text.Html;
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
import android.text.method.ScrollingMovementMethod;
|
|
import android.text.method.ScrollingMovementMethod;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
-import android.view.SurfaceHolder;
|
|
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
|
|
import android.view.Window;
|
|
import android.view.Window;
|
|
|
import android.view.WindowManager;
|
|
import android.view.WindowManager;
|
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebView;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
|
-import android.widget.ListView;
|
|
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
import android.widget.VideoView;
|
|
import android.widget.VideoView;
|
|
|
|
|
|
|
@@ -28,9 +25,9 @@ import com.bumptech.glide.Glide;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.sheep.gamegroup.model.entity.Advertising;
|
|
import com.sheep.gamegroup.model.entity.Advertising;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
-import com.sheep.gamegroup.model.entity.OrienteeringDetail;
|
|
|
|
|
import com.sheep.gamegroup.view.activity.SplashAct;
|
|
import com.sheep.gamegroup.view.activity.SplashAct;
|
|
|
-import com.sheep.gamegroup.view.adapter.ArrayAdapter;
|
|
|
|
|
|
|
+import com.sheep.gamegroup.view.dialog.DialogOrienteeringDetails;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
@@ -39,7 +36,6 @@ import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Created by realicing on 2018/5/11.
|
|
* Created by realicing on 2018/5/11.
|
|
@@ -369,7 +365,7 @@ public class ViewUtil {
|
|
|
final View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
final View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
View view = LayoutInflater.from(activity).inflate(R.layout.dialog_half_screen_ad, dialog_center_ll, true);
|
|
View view = LayoutInflater.from(activity).inflate(R.layout.dialog_half_screen_ad, dialog_center_ll, true);
|
|
|
- dialog_title.setText("推荐给好友");
|
|
|
|
|
|
|
+ setText(dialog_title, advertising.getName());
|
|
|
|
|
|
|
|
ImageView ad_iv = view.findViewById(R.id.ad_iv);
|
|
ImageView ad_iv = view.findViewById(R.id.ad_iv);
|
|
|
VideoView ad_video_view = view.findViewById(R.id.ad_video_view);
|
|
VideoView ad_video_view = view.findViewById(R.id.ad_video_view);
|
|
@@ -402,8 +398,9 @@ public class ViewUtil {
|
|
|
}
|
|
}
|
|
|
RxjavaCountDownTimer timer = null;
|
|
RxjavaCountDownTimer timer = null;
|
|
|
if (advertising.getShow_time() > 0) {
|
|
if (advertising.getShow_time() > 0) {
|
|
|
|
|
+ ad_skip.setVisibility(View.VISIBLE);
|
|
|
dialog.setCancelable(false);
|
|
dialog.setCancelable(false);
|
|
|
- timer = RxjavaCountDownTimer.getInstance(advertising.getShow_time())
|
|
|
|
|
|
|
+ timer = RxjavaCountDownTimer.getInstance(BuildConfig.DEBUG ? 1 : advertising.getShow_time())
|
|
|
.setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
.setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onFinish() {
|
|
public void onFinish() {
|
|
@@ -421,6 +418,8 @@ public class ViewUtil {
|
|
|
ad_skip.setText(activity.getString(R.string.tip_skip, time));
|
|
ad_skip.setText(activity.getString(R.string.tip_skip, time));
|
|
|
}
|
|
}
|
|
|
}).start();
|
|
}).start();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ad_skip.setVisibility(View.GONE);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
final RxjavaCountDownTimer finalTimer = timer;
|
|
final RxjavaCountDownTimer finalTimer = timer;
|
|
@@ -461,66 +460,7 @@ public class ViewUtil {
|
|
|
}
|
|
}
|
|
|
//显示定向货币详情
|
|
//显示定向货币详情
|
|
|
public static void showOrienteeringDetails() {
|
|
public static void showOrienteeringDetails() {
|
|
|
- final Activity activity = ActivityManager.getInstance().currentActivity();
|
|
|
|
|
- if (activity != null) {
|
|
|
|
|
- View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
|
|
|
|
|
- final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
|
|
|
|
|
- .setView(dialog_parent)
|
|
|
|
|
- .create();
|
|
|
|
|
- TextView dialog_title = dialog_parent.findViewById(R.id.dialog_title);
|
|
|
|
|
- final View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
|
|
- LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
|
|
- View view = LayoutInflater.from(activity).inflate(R.layout.dialog_orienteering_details, dialog_center_ll, true);
|
|
|
|
|
- dialog_title.setText("定向货币详情");
|
|
|
|
|
-
|
|
|
|
|
- ListView dialog_list_view = (ListView)view.findViewById(R.id.dialog_list_view);
|
|
|
|
|
- TextView dialog_btn_left = (TextView)view.findViewById(R.id.dialog_btn_left);
|
|
|
|
|
- TextView dialog_btn_right = (TextView)view.findViewById(R.id.dialog_btn_right);
|
|
|
|
|
-
|
|
|
|
|
- List<OrienteeringDetail> list = ListUtil.emptyList();
|
|
|
|
|
- list.add(new OrienteeringDetail());
|
|
|
|
|
- list.add(new OrienteeringDetail());
|
|
|
|
|
- list.add(new OrienteeringDetail());
|
|
|
|
|
- dialog_list_view.setAdapter(new ArrayAdapter<OrienteeringDetail>(activity, R.layout.dialog_orienteering_details_item, list){
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean convert(int position, View convertView, ViewGroup parent, OrienteeringDetail item) {
|
|
|
|
|
- //
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- dialog_btn_left.setText("确定");
|
|
|
|
|
- dialog_btn_left.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- dialog_btn_right.setText("充值");
|
|
|
|
|
- dialog_btn_right.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- Jump2View.getInstance().goRechargeAct(activity, null);
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- dialog_close.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onDismiss(DialogInterface dialogInterface) {
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- try {
|
|
|
|
|
- dialog.show();
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ new DialogOrienteeringDetails().showOrienteeringDetails();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void setText(TextView textView) {
|
|
public static void setText(TextView textView) {
|