danimahardhika / candybar-library

Android icon pack material dashboard
Apache License 2.0
496 stars 143 forks source link

[help] - RequestFragment - Crash #27

Closed MSay2 closed 7 years ago

MSay2 commented 7 years ago

The "RequestFragment" section crashes my project.

My log shows nothing

danimahardhika commented 7 years ago

When the dashboard crash, there will be a pop-up dialog, choose send report. Send it to my email danimahardhika112[at]gmail[dot]com, or open attached file (crash log.txt) and post it here.

Also which version of CandyBar are you using?

MSay2 commented 7 years ago

I was able to get the LogCat

I think this is loading applications that crash the application

02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-27 05:37:35.612 19441 19441 E   AndroidRuntime                               at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow
danimahardhika commented 7 years ago

@msay2 The logcat not related to CandyBar.

I told you before "When the dashboard crash, there will be a pop-up dialog, choose send report. Send it to my email danimahardhika112[at]gmail[dot]com, or open attached file (crashlog.txt) and post it here."

Also answer this question "Which version of CandyBar are you using?"

MSay2 commented 7 years ago

I use candybar 2.0.2.

I do not have this dialog (this bug is on my application that I develop at the moment)

screenshot_20170227-090608

In "RequestFragment" there is the method "getMissingApps", this is the method that crashes my application.

There is the "ProgressBar" which appears but before it even disappears it is at that moment that my crash application (I could join my "RequestFragment.java" if you want?)

danimahardhika commented 7 years ago

@msay2 So you did some modification? If yes let me see it, also what does the text inside dialog say?

MSay2 commented 7 years ago

The text in the dialog box says : "IlIon" has stopped."

package com.msay2.ilion;

import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.afollestad.materialdialogs.MaterialDialog;

//import com.anjlab.android.iab.v3.BillingProcessor;
//import com.anjlab.android.iab.v3.TransactionDetails;

import com.msay2.ilion.R;
import com.msay2.ilion.adapter.AdapterRequest;
import com.msay2.ilion.databases.Database;
import com.msay2.ilion.helpers.ColorHelper;
//import com.msay2.ilion.helpers.DeviceHelper;
import com.msay2.ilion.helpers.DrawableHelper;
//import com.msay2.ilion.helpers.FileHelper;
import com.msay2.ilion.helpers.RequestHelper;
import com.msay2.ilion.helpers.ViewHelper;
import com.msay2.ilion.item_data.ItemDataRequest;
import com.msay2.ilion.preferences.Preferences;
import com.msay2.ilion.util.Animator;
import com.msay2.ilion.util.Tags;
//import com.msay2.ilion.util.listener.InAppBillingListener;
import com.msay2.ilion.util.listener.RequestListener;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import com.msay2.ilion.config.*;

public class FragmentRequest extends Fragment implements View.OnClickListener
{
    private RecyclerView mRequestList;
    private FloatingActionButton mFab;
    private ProgressBar mProgress;
    private AppCompatButton mBuy;
    private TextView mDesc;
    private TextView mCount;

    private AdapterRequest mAdapter;
    private AsyncTask<Void, ItemDataRequest, Boolean> mGetMissingApps;
    public static List<ItemDataRequest> sMissingApps;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) 
    {
        View view = inflater.inflate(R.layout.activity_request, container, false);
        mRequestList = (RecyclerView) view.findViewById(R.id.request_list);
        mFab = (FloatingActionButton) view.findViewById(R.id.fab);
        mProgress = (ProgressBar) view.findViewById(R.id.progress);
        mBuy = (AppCompatButton) view.findViewById(R.id.premium_request_buy);
        mDesc = (TextView) view.findViewById(R.id.premium_request_desc);
        mCount = (TextView) view.findViewById(R.id.premium_request_count);

    return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) 
    {
        super.onActivityCreated(savedInstanceState);

    ViewCompat.setNestedScrollingEnabled(mRequestList, false);

        mProgress.getIndeterminateDrawable().setColorFilter(ColorHelper.getAttributeColor(getActivity(), R.attr.colorAccent), PorterDuff.Mode.SRC_IN);

        int color = ColorHelper.getTitleTextColor(ColorHelper.getAttributeColor(getActivity(), R.attr.colorAccent));
        mFab.setImageDrawable(DrawableHelper.getTintedDrawable(getActivity(), R.mipmap.ic_launcher, color));
        mFab.setOnClickListener(this);

        mRequestList.setItemAnimator(new DefaultItemAnimator());
        mRequestList.getItemAnimator().setChangeDuration(0);
        mRequestList.setHasFixedSize(false);
        mRequestList.setLayoutManager(new GridLayoutManager(getActivity(), 1));

        initPremiumRequest();
        getMissingApps();
    }

    @Override
    public void onDestroy()
    {
        if (mGetMissingApps != null)
        mGetMissingApps.cancel(true);

    super.onDestroy();
    }

    @Override
    public void onClick(View view) 
    {
        int id = view.getId();
        if (id == R.id.fab)
    {
            if (mAdapter == null) return;

            int selected = mAdapter.getSelectedItemsSize();
            if (selected > 0)
        {
                if (mAdapter.isContainsRequested())
        {
                    RequestHelper.showAlreadyRequestedDialog(getActivity());

            return;
                }

                boolean requestLimit = getActivity().getResources().getBoolean(R.bool.enable_icon_request_limit);
                boolean iconRequest = getActivity().getResources().getBoolean(R.bool.enable_icon_request);
                boolean premiumRequest = getActivity().getResources().getBoolean(R.bool.enable_premium_request);

            if (Preferences.getPreferences(getActivity()).isPremiumRequest())
        {
                    int count = Preferences.getPreferences(getActivity()).getPremiumRequestCount();
                    if (selected > count) 
            {
                        RequestHelper.showPremiumRequestLimitDialog(getActivity(), selected);

            return;
                    }

                    if (!RequestHelper.isReadyToSendPremiumRequest(getActivity())) return;

                    try 
            {
                        //InAppBillingListener listener = (InAppBillingListener) getActivity();
                        //listener.OnInAppBillingRequest();
                    } 
            catch (Exception ignored) 
            { }
                    return;
                }

                if (!iconRequest && premiumRequest)
        {
                    RequestHelper.showPremiumRequestRequired(getActivity());

            return;
                }

                if (requestLimit)
        {
                    int limit = 10;
                    int used = Preferences.getPreferences(getActivity()).getRegularRequestUsed();
                    if (selected > (limit - used))
            {
                        RequestHelper.showIconRequestLimitDialog(getActivity());

            return;
                    }

                    Preferences.getPreferences(getActivity()).setRegularRequestUsed(selected);
                }

               // sendRequest(null);
            } 

        else
        {
                Toast.makeText(getActivity(), R.string.request_not_selected, Toast.LENGTH_LONG).show();
            }
        } 

    else if (id == R.id.premium_request_buy) 
    {
            RequestListener listener = (RequestListener) getActivity();
            listener.OnBuyPremiumRequest();
        }
    }

    private void initPremiumRequest()
    {
        boolean premiumRequest = Preferences.getPreferences(getActivity()).isPremiumRequestEnabled();
        if (premiumRequest) 
    {
            LinearLayout premiumRequestBar = (LinearLayout) getActivity().findViewById(R.id.premium_request_bar);
            premiumRequestBar.setVisibility(View.VISIBLE);

            int accent = ColorHelper.getAttributeColor(getActivity(), R.attr.colorAccent);
            mBuy.setTextColor(ColorHelper.getTitleTextColor(accent));
            mBuy.setOnClickListener(this);

            int toolbarIcon = ColorHelper.getAttributeColor(getActivity(), android.R.attr.textColorSecondary);
            mDesc.setTextColor(ColorHelper.setColorAlpha(toolbarIcon, 0.6f));

            initPremiumRequestCount();
        }
    }

    private void initPremiumRequestCount()
    {
        if (Preferences.getPreferences(getActivity()).isPremiumRequest())
    {
            String countText = getActivity().getResources().getString(R.string.premium_request_count) +" "+ Preferences.getPreferences(getActivity()).getPremiumRequestCount();

        mCount.setText(countText);
            mCount.setVisibility(View.VISIBLE);
            mBuy.setVisibility(View.GONE);
        return;
        }

        mCount.setVisibility(View.GONE);
        mBuy.setVisibility(View.VISIBLE);
    }

    /*public void OnInAppBillingSent(BillingProcessor billingProcessor) 
    {
        sendRequest(billingProcessor);
    }*/

    public void premiumRequestBought()
    {
        initPremiumRequestCount();
    }

    private void getMissingApps()
    {
        mGetMissingApps = new AsyncTask<Void, ItemDataRequest, Boolean>() 
    {
            List<ItemDataRequest> requests;

            @Override
            protected void onPreExecute()
        {
                super.onPreExecute();
                if (sMissingApps == null)
                    mProgress.setVisibility(View.VISIBLE);
            }

            @Override
            protected Boolean doInBackground(Void... voids) 
        {
                while (!isCancelled())
        {
                    try
            {
                        Thread.sleep(1);
                        if (sMissingApps == null) 
            {
                            sMissingApps = RequestHelper.loadMissingApps(getActivity());
                        }

                        requests = sMissingApps;

            return true;
                    }
            catch (Exception e) 
            {
                        Log.d(Tags.LOG_TAG, Log.getStackTraceString(e));
                        return false;
                    }
                }
                return false;
            }

            @Override
            protected void onPostExecute(Boolean aBoolean) 
        {
                super.onPostExecute(aBoolean);

        mProgress.setVisibility(View.GONE);
                if (aBoolean)
        {
                    mAdapter = new AdapterRequest(getActivity(), requests);
                    mRequestList.setAdapter(mAdapter);
                } 

        else 
        {
                    mRequestList.setAdapter(null);
                    Toast.makeText(getActivity(), getActivity().getResources().getString(R.string.request_appfilter_failed), Toast.LENGTH_LONG).show();
                }
                mGetMissingApps = null;
            }

        }.execute();
    }

    /*private void sendRequest(BillingProcessor billingProcessor) {
        new AsyncTask<Void, Void, Boolean>() {

            MaterialDialog dialog;
            StringBuilder sb;
            String zipFile;
            String productId = "";
            String orderId = "";

            @Override
            protected void onPreExecute() {
                super.onPreExecute();
                sb = new StringBuilder();

                MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
                builder.content(R.string.request_building);
                builder.cancelable(false);
                builder.canceledOnTouchOutside(false);
                builder.progress(true, 0);
                builder.progressIndeterminateStyle(true);
                dialog = builder.build();
                dialog.show();
            }

            @Override
            protected Boolean doInBackground(Void... voids) {
                while (!isCancelled()) {
                    try {
                        Thread.sleep(1);
                        Database database = new Database(getActivity());
                        File directory = getActivity().getCacheDir();
                        sb.append(DeviceHelper.getDeviceInfo(getActivity()));

                        if (Preferences.getPreferences(getActivity()).isPremiumRequest()) {
                            if (billingProcessor == null) return false;
                            TransactionDetails details = billingProcessor.getPurchaseTransactionDetails(
                                    Preferences.getPreferences(getActivity()).getPremiumRequestProductId());
                            if (details != null) {
                                orderId = details.purchaseInfo.purchaseData.orderId;
                                productId = details.purchaseInfo.purchaseData.productId;
                                sb.append("Order Id : ").append(orderId)
                                        .append("\nProduct Id : ").append(productId)
                                        .append("\n");
                            }
                        }

                        List<Integer> selectedItems = mAdapter.getSelectedItems();
                        List<String> files = new ArrayList<>();
                        File appFilter = new File(directory.toString() + "/" + "appfilter.xml");

                        Writer out = new BufferedWriter(new OutputStreamWriter(
                                new FileOutputStream(appFilter), "UTF8"));

                        for (int i = 0; i < selectedItems.size(); i++) {
                            Request item = mAdapter.getRequest(selectedItems.get(i));
                            database.addRequest(item.getName(), item.getActivity(), null);
                            mAdapter.setRequested(selectedItems.get(i), true);

                            String string = RequestHelper.writeRequest(item);
                            sb.append(string);

                            String string1 = RequestHelper.writeAppFilter(item);
                            out.append(string1);

                            Bitmap bitmap = DrawableHelper.getHighQualityIcon(
                                    getActivity(), item.getPackageName());

                            String icon = FileHelper.saveIcon(directory, bitmap, item.getName());
                            if (icon != null) files.add(icon);

                            if (Preferences.getPreferences(getActivity()).isPremiumRequest()) {
                                database.addPremiumRequest(orderId, productId, item.getName(), item.getActivity());
                            }
                        }

                        out.flush();
                        out.close();
                        files.add(appFilter.toString());

                        zipFile = directory.toString() + "/" + "icon_request.zip";
                        FileHelper.createZip(files, zipFile);
                        return true;
                    } catch (Exception e) {
                        Log.d(Tag.LOG_TAG, Log.getStackTraceString(e));
                        return false;
                    }
                }
                return false;
            }

            @Override
            protected void onPostExecute(Boolean aBoolean) {
                super.onPostExecute(aBoolean);
                dialog.dismiss();
                if (aBoolean) {
                    String subject = Preferences.getPreferences(getActivity()).isPremiumRequest() ?
                            "Premium Icon Request " : "Icon Request ";
                    subject = subject + getActivity().getResources().getString(R.string.app_name);

                    Request request = new Request(subject, sb.toString(),
                            zipFile, mAdapter.getSelectedItemsSize());
                    try {
                        RequestListener listener = (RequestListener) getActivity();
                        listener.OnRequestBuilt(request);
                    } catch (Exception ignored) {}
                    mAdapter.resetSelectedItems();
                } else {
                    Toast.makeText(getActivity(), R.string.request_build_failed,
                            Toast.LENGTH_LONG).show();
                }
                dialog = null;
                sb.setLength(0);
                sb.trimToSize();
            }

        }.execute();
    }*/
}
danimahardhika commented 7 years ago

@msay2 It's hard to tell only by seeing this part, at least you need to get the logcat first

MSay2 commented 7 years ago

My LogCat

02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               FATAL EXCEPTION: main
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               Process: com.msay2.ilion, PID: 21459
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               Theme: themes:{default=overlay:system, iconPack:system, fontPkg:system, com.android.systemui=overlay:system, com.android.systemui.navbar=overlay:system}
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               java.lang.IllegalStateException: ImageLoader must be init with configuration before using
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at com.nostra13.universalimageloader.core.ImageLoader.checkConfiguration(ImageLoader.java:613)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at com.nostra13.universalimageloader.core.ImageLoader.displayImage(ImageLoader.java:236)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at com.msay2.ilion.adapter.AdapterRequest.onBindViewHolder(AdapterRequest.java:65)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at com.msay2.ilion.adapter.AdapterRequest.onBindViewHolder(AdapterRequest.java)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5825)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5858)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5094)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4970)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2029)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:541)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3315)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3124)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3568)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1197)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1735)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1579)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.LinearLayout.onLayout(LinearLayout.java:1488)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.View.layout(View.java:16639)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.view.ViewGroup.layout(ViewGroup.java:5437)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
02-28 05:17:40.186 21459 21459 E   AndroidRuntime                               at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow
danimahardhika commented 7 years ago

This is the problem

java.lang.IllegalStateException: ImageLoader must be init with configuration before using

You need to init Universal Image Loader first inside Application

if (!ImageLoader.getInstance().isInited())
            ImageLoader.getInstance().init(ImageConfig.getImageLoaderConfiguration(this));

Take a look inside CandyBarApplication.java for sample

MSay2 commented 7 years ago

Hi, this still does not work. (ImageLoader does not work)

I thought I was going to take the bookseller "Glide" to start a test, but with "Glide" the images are not found

screenshot_20170301-073308

I figured I'd fix it later.

Currently I discover a very strange bug ...

... When I select an object the notch is activated, but a lower object activates itself, inversely (When I deselect an object, the previously selected object deselects alone).

danimahardhika commented 7 years ago

@msay2 You need to use my Universal Image Loader configuration, take a look inside ImageConfig.java

public static ImageLoaderConfiguration getImageLoaderConfiguration(@NonNull Context context) {
        return new ImageLoaderConfiguration.Builder(context)
                .diskCacheSize(200 * 1024 * 1024)
                .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
                .memoryCacheSize(2 * 2014 * 1024)
                .threadPriority(Thread.NORM_PRIORITY - 2)
                .threadPoolSize(4)
                .tasksProcessingOrder(QueueProcessingType.FIFO)
                .imageDownloader(new ImageDownloader(context))
                .diskCache(new UnlimitedDiskCache(new File(
                        context.getCacheDir().toString() + "/uil-images")))
                .build();
}

For the second one, it's not a bug. Since you are modifying library source, probably you did wrong implementation.

MSay2 commented 7 years ago

That's it, it's working now.

In your CandyBarApplication there is the method named initApplication which executes the onCreate ...

... it is because of this that my application as stopped.

Here is my IlIonApplication :


import android.app.Application;
import android.content.Intent;

import com.msay2.ilion.SplashScreen;
import com.msay2.ilion.util.ImageConfig;

import com.nostra13.universalimageloader.core.ImageLoader;

import android.content.res.Configuration;

public class IlIonApplication extends Application
{
    private static IlIonApplication getIlIon;

    public static IlIonApplication getInstance()
    {
        return getIlIon;
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig)
    {
        super.onConfigurationChanged(newConfig);
    }

    @Override
    public void onCreate()
    {
        super.onCreate();

        getIlIon = this;

        if (!ImageLoader.getInstance().isInited())
        {
            ImageLoader.getInstance().init(ImageConfig.getImageLoaderConfiguration(this));
        }
    }
}

Thanks Dani 👍

danimahardhika commented 7 years ago

@msay2 If you want to modify the library, you need to figure it out by yourself.

If you got a problem, why don't you just using it as it is, just need to do a few steps to setup candybar Setup

MSay2 commented 7 years ago

Cool, thanks 👍