Refactor presenters to the "presenters" package, fixed throttling text (tree level 3), added default image when no images.

This commit is contained in:
ChronosX88 2019-02-16 19:42:20 +04:00
parent 5dc987d0b8
commit 174753d78c
No known key found for this signature in database
GPG Key ID: 8F92E090A87804AA
15 changed files with 151 additions and 14 deletions

View File

@ -3,6 +3,135 @@
<component name="WizardSettings"> <component name="WizardSettings">
<option name="children"> <option name="children">
<map> <map>
<entry key="imageWizard">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="imageAssetPanel">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="actionbar">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="clipArt">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="color" value="000000" />
</map>
</option>
</PersistentState>
</value>
</entry>
<entry key="image">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="color" value="000000" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
<option name="values">
<map>
<entry key="assetType" value="IMAGE" />
<entry key="imageAsset" value="$PROJECT_DIR$/app/src/main/res/drawable/no-images.png" />
<entry key="outputName" value="img_no_images" />
<entry key="theme" value="HOLO_DARK" />
<entry key="themeColor" value="ffffff" />
</map>
</option>
</PersistentState>
</value>
</entry>
<entry key="launcher">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="foregroundImage">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="color" value="000000" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
<entry key="launcherLegacy">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="clipArt">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="color" value="000000" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
<entry key="notification">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="clipArt">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="color" value="000000" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
<option name="values">
<map>
<entry key="outputIconType" value="ACTIONBAR" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
<entry key="vectorWizard"> <entry key="vectorWizard">
<value> <value>
<PersistentState> <PersistentState>

Binary file not shown.

View File

@ -15,9 +15,11 @@ import com.squareup.picasso.Picasso;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import ru.volgorobot.vrcatalog.R;
public class ImagePagerAdapter extends PagerAdapter { public class ImagePagerAdapter extends PagerAdapter {
/** /**
* This class is designed to control the ViewPager (images of item) in the activity of viewing details of items. * This class is designed to control the ViewPager (images of item) in the activity of viewing details of items (DetailActivity).
*/ */
private Context context; private Context context;
@ -26,6 +28,10 @@ public class ImagePagerAdapter extends PagerAdapter {
public ImagePagerAdapter(Context context, String[] imageUris) { public ImagePagerAdapter(Context context, String[] imageUris) {
this.context = context; this.context = context;
this.imageUris = imageUris; this.imageUris = imageUris;
if(this.imageUris.length == 0) {
this.imageUris = new String[1];
this.imageUris[0] = Uri.parse("android.resource://ru.volgorobot.vrcatalog/" + R.drawable.no_images).toString();
}
} }
@Override @Override

View File

@ -9,7 +9,7 @@ import me.texy.treeview.TreeNode;
import me.texy.treeview.base.BaseNodeViewBinder; import me.texy.treeview.base.BaseNodeViewBinder;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.ViewBinderPresenter; import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
import ru.volgorobot.vrcatalog.model.FirstLevelModel; import ru.volgorobot.vrcatalog.model.FirstLevelModel;
public class FirstLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder { public class FirstLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {

View File

@ -9,7 +9,7 @@ import me.texy.treeview.TreeNode;
import me.texy.treeview.base.BaseNodeViewBinder; import me.texy.treeview.base.BaseNodeViewBinder;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.ViewBinderPresenter; import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
import ru.volgorobot.vrcatalog.model.SecondLevelModel; import ru.volgorobot.vrcatalog.model.SecondLevelModel;
public class SecondLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder { public class SecondLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {

View File

@ -8,7 +8,7 @@ import me.texy.treeview.TreeNode;
import me.texy.treeview.base.BaseNodeViewBinder; import me.texy.treeview.base.BaseNodeViewBinder;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.ViewBinderPresenter; import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
import ru.volgorobot.vrcatalog.model.ThirdLevelModel; import ru.volgorobot.vrcatalog.model.ThirdLevelModel;
public class ThirdLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder { public class ThirdLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {

View File

@ -1,4 +1,4 @@
package ru.volgorobot.vrcatalog; package ru.volgorobot.vrcatalog.presenters;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
@ -15,6 +15,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.UUID; import java.util.UUID;
import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.additional.NetworkErrorException; import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode; import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
import ru.volgorobot.vrcatalog.model.CoreModel; import ru.volgorobot.vrcatalog.model.CoreModel;

View File

@ -1,10 +1,11 @@
package ru.volgorobot.vrcatalog; package ru.volgorobot.vrcatalog.presenters;
import android.content.Context; import android.content.Context;
import android.os.AsyncTask; import android.os.AsyncTask;
import java.util.ArrayList; import java.util.ArrayList;
import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.additional.NetworkErrorException; import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode; import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
import ru.volgorobot.vrcatalog.model.CoreModel; import ru.volgorobot.vrcatalog.model.CoreModel;

View File

@ -1,4 +1,4 @@
package ru.volgorobot.vrcatalog; package ru.volgorobot.vrcatalog.presenters;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
@ -7,6 +7,7 @@ import android.os.AsyncTask;
import java.util.ArrayList; import java.util.ArrayList;
import me.texy.treeview.TreeNode; import me.texy.treeview.TreeNode;
import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.additional.NetworkErrorException; import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
import ru.volgorobot.vrcatalog.model.CoreModel; import ru.volgorobot.vrcatalog.model.CoreModel;
import ru.volgorobot.vrcatalog.model.FirstLevelModel; import ru.volgorobot.vrcatalog.model.FirstLevelModel;

View File

@ -1,4 +1,4 @@
package ru.volgorobot.vrcatalog; package ru.volgorobot.vrcatalog.presenters;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -7,6 +7,7 @@ import android.os.AsyncTask;
import java.util.ArrayList; import java.util.ArrayList;
import me.texy.treeview.TreeNode; import me.texy.treeview.TreeNode;
import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.additional.NetworkErrorException; import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode; import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
import ru.volgorobot.vrcatalog.model.CoreModel; import ru.volgorobot.vrcatalog.model.CoreModel;

View File

@ -7,8 +7,6 @@ import android.os.Bundle;
import android.support.design.widget.TabLayout; import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.MenuItem; import android.view.MenuItem;
@ -21,7 +19,7 @@ import android.widget.Toast;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import ru.volgorobot.vrcatalog.ItemPresenter; import ru.volgorobot.vrcatalog.presenters.ItemPresenter;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.additional.ImagePagerAdapter; import ru.volgorobot.vrcatalog.additional.ImagePagerAdapter;

View File

@ -30,7 +30,7 @@ import java.util.ArrayList;
import me.texy.treeview.TreeNode; import me.texy.treeview.TreeNode;
import me.texy.treeview.TreeView; import me.texy.treeview.TreeView;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.MainPresenter; import ru.volgorobot.vrcatalog.presenters.MainPresenter;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.additional.NodeViewFactory; import ru.volgorobot.vrcatalog.additional.NodeViewFactory;
import ru.volgorobot.vrcatalog.model.FirstLevelModel; import ru.volgorobot.vrcatalog.model.FirstLevelModel;

View File

@ -21,7 +21,7 @@ import me.texy.treeview.TreeNode;
import me.texy.treeview.TreeView; import me.texy.treeview.TreeView;
import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.MainContract;
import ru.volgorobot.vrcatalog.R; import ru.volgorobot.vrcatalog.R;
import ru.volgorobot.vrcatalog.SearchablePresenter; import ru.volgorobot.vrcatalog.presenters.SearchablePresenter;
import ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider; import ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider;
import ru.volgorobot.vrcatalog.additional.SearchableNodeViewFactory; import ru.volgorobot.vrcatalog.additional.SearchableNodeViewFactory;
import ru.volgorobot.vrcatalog.model.FirstLevelModel; import ru.volgorobot.vrcatalog.model.FirstLevelModel;

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:background="?android:selectableItemBackground"> android:background="?android:selectableItemBackground">