|
|
@@ -12,15 +12,23 @@ import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
import android.support.design.widget.TabLayout;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
|
+import android.support.v7.widget.GridLayoutManager;
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
import android.text.Html;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.TypedValue;
|
|
|
+import android.view.Gravity;
|
|
|
+import android.view.LayoutInflater;
|
|
|
+import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.view.ViewTreeObserver;
|
|
|
+import android.view.WindowManager;
|
|
|
import android.webkit.WebView;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
+import android.widget.PopupWindow;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -63,7 +71,11 @@ import com.sheep.gamegroup.model.entity.WithdrawalEty;
|
|
|
import com.sheep.gamegroup.model.entity.XiaomiGameEntity;
|
|
|
import com.sheep.gamegroup.model.util.EntityUtils;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
+import com.sheep.gamegroup.module.home.adapter.AdpDailyPlay;
|
|
|
+import com.sheep.gamegroup.module.home.adapter.AdpHomeList;
|
|
|
+import com.sheep.gamegroup.module.skin.util.SkinUtil;
|
|
|
import com.sheep.gamegroup.usage.AppUsageManager;
|
|
|
+import com.sheep.gamegroup.util.viewHelper.PopupWindowUtil;
|
|
|
import com.sheep.gamegroup.view.activity.ActMain;
|
|
|
import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
|
|
|
import com.sheep.gamegroup.view.activity.ActWebX5YF;
|
|
|
@@ -2778,4 +2790,54 @@ public class CommonUtil {
|
|
|
public boolean hasYouFanLauncher() {
|
|
|
return DataUtil.getAsBoolean(ActWebX5YF.KEY_HAS_YOU_FAN_LAUNCHER, false);
|
|
|
}
|
|
|
+
|
|
|
+ public void showHomeList(Activity activity, List<HomeListEntity> child_list, View anchor) {
|
|
|
+ CharSequence copyText = StringUtils.getCopyText();
|
|
|
+ String copy;
|
|
|
+ if(copyText == null){
|
|
|
+ copy = "1;0;100;35;-50";
|
|
|
+ } else {
|
|
|
+ copy = copyText.toString();
|
|
|
+ }
|
|
|
+ String[] items = copy.split(";");
|
|
|
+ int i = 0;
|
|
|
+ int n = Integer.parseInt(items[i++]);
|
|
|
+ int p = Integer.parseInt(items[i++]);
|
|
|
+ int w = Integer.parseInt(items[i++]);
|
|
|
+ int x = Integer.parseInt(items[i++]);
|
|
|
+ int y = Integer.parseInt(items[i++]);
|
|
|
+ while (n != child_list.size()){
|
|
|
+ if(n > child_list.size())
|
|
|
+ child_list.add(child_list.get(0));
|
|
|
+ else
|
|
|
+ child_list.remove(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ View contentView = LayoutInflater.from(activity).inflate(R.layout.pop_hom_list_tip, null, false);
|
|
|
+ int padding = G.getRealPix(p);
|
|
|
+ contentView.setPadding(padding, padding, padding, padding);
|
|
|
+ RecyclerView home_list_rv = contentView.findViewById(R.id.view_list);
|
|
|
+
|
|
|
+ int size = child_list.size();
|
|
|
+ int spanCount = Math.min(3, size);
|
|
|
+ int hang = ListUtil.getTotalPage(size, spanCount);
|
|
|
+ GridLayoutManager manager = new GridLayoutManager(SheepApp.getInstance(), spanCount);
|
|
|
+ home_list_rv.setHasFixedSize(true);
|
|
|
+ home_list_rv.setNestedScrollingEnabled(false);
|
|
|
+ home_list_rv.setLayoutManager(manager);
|
|
|
+ AdpHomeList<HomeListEntity> adpHomeList = new AdpHomeList<>(R.layout.item_my_list_but2, child_list);
|
|
|
+ adpHomeList.bindToRecyclerView(home_list_rv);
|
|
|
+ adpHomeList.setOnItemClickListener((adapter, view, position) -> {
|
|
|
+ HomeListEntity item = ListUtil.getItem(child_list, position);
|
|
|
+ if (item == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ UMConfigUtils.IdEvent.HOME_LIST.commit(item.getId());
|
|
|
+ CommonUtil.getInstance().goWhere(activity, item, "首页");
|
|
|
+ });
|
|
|
+
|
|
|
+ PopupWindowUtil.showLayout(activity, new PopupWindowUtil.PopupWindowParams(contentView).setAnchor(anchor)
|
|
|
+ .setWidth(G.getRealPix(spanCount * w + p)).setXoff(G.getRealPix(x)).setYoff(G.getRealPix(y))
|
|
|
+ .setGravity(Gravity.BOTTOM).setOutsideTouchable(true).setFocusable(true));
|
|
|
+ }
|
|
|
}
|