导航菜单

页面标题

页面副标题

SpeedCash v6.5.1482 - PromoEntity.java 源代码

正在查看: SpeedCash v6.5.1482 应用的 PromoEntity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bm.sc.bebasbayar.adapter.entity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.entity.PromoEntity;
import com.bm.sc.bebasbayar.handler.FirebaseProcessor;
import com.bm.sc.bebasbayar.ui.activity.info.OpenWebViewActivity;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import eu.davidea.flexibleadapter.FlexibleAdapter;
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
import eu.davidea.flexibleadapter.items.IFlexible;
import eu.davidea.viewholders.FlexibleViewHolder;
import java.util.Date;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class PromoEntity extends AbstractFlexibleItem<ViewHolder> {
    public String a;
    public String b;
    public String c;
    public String d;
    public String e;
    public String f;
    public String[] g;
    public Date h;

    public static class ViewHolder extends FlexibleViewHolder {
        public final ImageView x;
        public final TextView y;

        public ViewHolder(View view, FlexibleAdapter flexibleAdapter) {
            super(view, flexibleAdapter);
            view.findViewById(R.id.coin).setVisibility(8);
            view.findViewById(R.id.vcr_redeem).setVisibility(8);
            this.x = (ImageView) view.findViewById(R.id.vcr_img);
            TextView textView = (TextView) view.findViewById(R.id.vcr_poin);
            this.y = textView;
            LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) textView.getLayoutParams();
            int i = layoutParams.leftMargin;
            int i2 = layoutParams.topMargin;
            layoutParams.setMargins(i, i2, layoutParams.rightMargin, i2);
            textView.setLayoutParams(layoutParams);
        }
    }

    public PromoEntity() {
    }

    public void b(View view) {
        String url_link = (getUrl_link().contains("http") || getUrl_link().contains("https")) ? getUrl_link() : "https://blog.speedcash.co.id/";
        Bundle bundle = new Bundle();
        bundle.putString("url", url_link);
        bundle.putString(FirebaseProcessor.KEY_TITLE, this.c);
        Intent intent = new Intent(view.getContext(), (Class<?>) OpenWebViewActivity.class);
        intent.putExtras(bundle);
        view.getContext().startActivity(intent);
    }

    public void bindViewHolder(FlexibleAdapter flexibleAdapter, RecyclerView.ViewHolder viewHolder, int i, List list) {
        bindViewHolder((FlexibleAdapter<IFlexible>) flexibleAdapter, (ViewHolder) viewHolder, i, (List<Object>) list);
    }

    public JSONObject buildJSONObjectForPromosi() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put(FirebaseProcessor.KEY_TITLE, this.c);
            jSONObject.put("id", this.a);
            jSONObject.put("url_link", this.d);
            jSONObject.put("url_image", this.b);
            jSONObject.put("url_image_mini", this.e);
            jSONObject.put("content", this.f);
            return jSONObject;
        } catch (JSONException e) {
            e.printStackTrace();
            return null;
        }
    }

    public boolean equals(Object obj) {
        return false;
    }

    public String[] getContent() {
        return this.g;
    }

    public String getContent2() {
        return this.f;
    }

    public Date getEnd_published() {
        return this.h;
    }

    public String getId() {
        return this.a;
    }

    public int getLayoutRes() {
        return R.layout.component_voucher_promo;
    }

    public String getTitle() {
        return this.c;
    }

    public String getUrl_image() {
        return this.b;
    }

    public String getUrl_image_mini() {
        return this.e;
    }

    public String getUrl_link() {
        return this.d;
    }

    public void setContent(String[] strArr) {
        this.g = strArr;
    }

    public void setContent2(String str) {
        this.f = str;
    }

    public void setEnd_published(Date date) {
        this.h = date;
    }

    public void setTitle(String str) {
        this.c = str;
    }

    public void setUrl_image(String str) {
        this.b = str;
    }

    public void setUrl_image_mini(String str) {
        this.e = str;
    }

    public void setUrl_link(String str) {
        this.d = str;
    }

    public PromoEntity(String str) {
        this.a = str;
    }

    public void bindViewHolder(FlexibleAdapter<IFlexible> flexibleAdapter, ViewHolder viewHolder, int i, List<Object> list) {
        TextView textView = viewHolder.y;
        textView.setTextColor(ContextCompat.getColor(textView.getContext(), R.color.Black));
        viewHolder.y.setText(this.c);
        Glide.with(viewHolder.x.getContext()).load(this.b).apply(new RequestOptions().override(viewHolder.x.getWidth(), viewHolder.x.getHeight()).placeholder(R.drawable.bb_info_loading_image).error(R.drawable.bb_info_loading_image).diskCacheStrategy(DiskCacheStrategy.ALL)).into(viewHolder.x);
        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                PromoEntity.this.b(view);
            }
        });
    }

    public ViewHolder createViewHolder(View view, FlexibleAdapter flexibleAdapter) {
        return new ViewHolder(view, flexibleAdapter);
    }

    public PromoEntity(String str, String str2, String str3) {
        this.b = str;
        this.c = str2;
        this.d = str3;
    }
}