Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
aed3cfb794
@ -3,6 +3,135 @@
|
||||
<component name="WizardSettings">
|
||||
<option name="children">
|
||||
<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">
|
||||
<value>
|
||||
<PersistentState>
|
||||
|
Binary file not shown.
@ -6,8 +6,8 @@ android {
|
||||
applicationId "ru.volgorobot.vrcatalog"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 27
|
||||
versionCode 4
|
||||
versionName "0.3"
|
||||
versionCode 5
|
||||
versionName "0.3.1"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
compileOptions {
|
||||
|
@ -41,6 +41,8 @@
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:name=".additional.RecentSuggestionProvider"
|
||||
android:authorities="ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -15,9 +15,11 @@ import com.squareup.picasso.Picasso;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
|
||||
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;
|
||||
@ -26,6 +28,10 @@ public class ImagePagerAdapter extends PagerAdapter {
|
||||
public ImagePagerAdapter(Context context, String[] imageUris) {
|
||||
this.context = context;
|
||||
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
|
||||
|
@ -0,0 +1,12 @@
|
||||
package ru.volgorobot.vrcatalog.additional;
|
||||
|
||||
import android.content.SearchRecentSuggestionsProvider;
|
||||
|
||||
public class RecentSuggestionProvider extends SearchRecentSuggestionsProvider {
|
||||
public final static String AUTHORITY = "ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider";
|
||||
public final static int MODE = DATABASE_MODE_QUERIES;
|
||||
|
||||
public RecentSuggestionProvider() {
|
||||
setupSuggestions(AUTHORITY, MODE);
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@ import me.texy.treeview.TreeNode;
|
||||
import me.texy.treeview.base.BaseNodeViewBinder;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
import ru.volgorobot.vrcatalog.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.model.FirstLevelModel;
|
||||
|
||||
public class FirstLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {
|
||||
|
@ -9,7 +9,7 @@ import me.texy.treeview.TreeNode;
|
||||
import me.texy.treeview.base.BaseNodeViewBinder;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
import ru.volgorobot.vrcatalog.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.model.SecondLevelModel;
|
||||
|
||||
public class SecondLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {
|
||||
|
@ -8,7 +8,7 @@ import me.texy.treeview.TreeNode;
|
||||
import me.texy.treeview.base.BaseNodeViewBinder;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
import ru.volgorobot.vrcatalog.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.presenters.ViewBinderPresenter;
|
||||
import ru.volgorobot.vrcatalog.model.ThirdLevelModel;
|
||||
|
||||
public class ThirdLevelNodeViewBinder extends BaseNodeViewBinder implements MainContract.ViewBinder {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package ru.volgorobot.vrcatalog;
|
||||
package ru.volgorobot.vrcatalog.presenters;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@ -15,6 +15,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
|
||||
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
|
||||
import ru.volgorobot.vrcatalog.model.CoreModel;
|
@ -1,10 +1,11 @@
|
||||
package ru.volgorobot.vrcatalog;
|
||||
package ru.volgorobot.vrcatalog.presenters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
|
||||
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
|
||||
import ru.volgorobot.vrcatalog.model.CoreModel;
|
@ -1,4 +1,4 @@
|
||||
package ru.volgorobot.vrcatalog;
|
||||
package ru.volgorobot.vrcatalog.presenters;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
@ -7,6 +7,7 @@ import android.os.AsyncTask;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import me.texy.treeview.TreeNode;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
|
||||
import ru.volgorobot.vrcatalog.model.CoreModel;
|
||||
import ru.volgorobot.vrcatalog.model.FirstLevelModel;
|
@ -1,4 +1,4 @@
|
||||
package ru.volgorobot.vrcatalog;
|
||||
package ru.volgorobot.vrcatalog.presenters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@ -7,6 +7,7 @@ import android.os.AsyncTask;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import me.texy.treeview.TreeNode;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.additional.NetworkErrorException;
|
||||
import ru.volgorobot.vrcatalog.additional.ResultWithErrorCode;
|
||||
import ru.volgorobot.vrcatalog.model.CoreModel;
|
@ -7,8 +7,6 @@ import android.os.Bundle;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.view.ViewPager;
|
||||
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.util.Log;
|
||||
import android.view.MenuItem;
|
||||
@ -21,7 +19,7 @@ import android.widget.Toast;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import ru.volgorobot.vrcatalog.ItemPresenter;
|
||||
import ru.volgorobot.vrcatalog.presenters.ItemPresenter;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
import ru.volgorobot.vrcatalog.additional.ImagePagerAdapter;
|
||||
|
@ -30,7 +30,7 @@ import java.util.ArrayList;
|
||||
import me.texy.treeview.TreeNode;
|
||||
import me.texy.treeview.TreeView;
|
||||
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.additional.NodeViewFactory;
|
||||
import ru.volgorobot.vrcatalog.model.FirstLevelModel;
|
||||
|
@ -3,6 +3,7 @@ package ru.volgorobot.vrcatalog.view;
|
||||
import android.app.SearchManager;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchRecentSuggestions;
|
||||
import android.support.v4.widget.NestedScrollView;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
@ -20,7 +21,8 @@ import me.texy.treeview.TreeNode;
|
||||
import me.texy.treeview.TreeView;
|
||||
import ru.volgorobot.vrcatalog.MainContract;
|
||||
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.SearchableNodeViewFactory;
|
||||
import ru.volgorobot.vrcatalog.model.FirstLevelModel;
|
||||
|
||||
@ -59,6 +61,9 @@ public class SearchableActivity extends AppCompatActivity implements MainContrac
|
||||
detailName = intent.getStringExtra(SearchManager.QUERY);
|
||||
getSupportActionBar().setTitle("Поиск: " + detailName);
|
||||
searchablePresenter.fetchDetailsTreeByName(detailName);
|
||||
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(this,
|
||||
RecentSuggestionProvider.AUTHORITY, RecentSuggestionProvider.MODE);
|
||||
suggestions.saveRecentQuery(detailName, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
package ru.volgorobot.vrcatalog.view;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.provider.SearchRecentSuggestions;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import ru.volgorobot.vrcatalog.R;
|
||||
import ru.volgorobot.vrcatalog.additional.AppCompatPreferenceActivity;
|
||||
import ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider;
|
||||
|
||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
|
||||
@ -15,6 +20,32 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
|
||||
Preference clearSearchHistoryButton = findPreference("clearSearchHistoryButton");
|
||||
clearSearchHistoryButton.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(SettingsActivity.this)
|
||||
.setTitle("Подтвердите действие")
|
||||
.setMessage("Вы уверены, что хотите очистить историю вашего поиска?")
|
||||
.setPositiveButton("ОК", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
SearchRecentSuggestions suggestions = new SearchRecentSuggestions(SettingsActivity.this,
|
||||
RecentSuggestionProvider.AUTHORITY, RecentSuggestionProvider.MODE);
|
||||
suggestions.clearHistory();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Отмена", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
dialogBuilder.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
BIN
app/src/main/res/drawable/no_images.png
Normal file
BIN
app/src/main/res/drawable/no_images.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 748 B |
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="?android:selectableItemBackground">
|
||||
|
||||
|
@ -5,4 +5,7 @@
|
||||
android:title="Адрес API-сервера"
|
||||
android:summary="API-сервер необходим для доступа к БД деталей"
|
||||
android:defaultValue="http://example.com"/>
|
||||
<Preference
|
||||
android:title="Очистить историю поиска"
|
||||
android:key="clearSearchHistoryButton"/>
|
||||
</PreferenceScreen>
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:label="@string/app_name"
|
||||
android:hint="Поиск деталей по имени" >
|
||||
android:hint="Поиск деталей по имени"
|
||||
android:searchSuggestAuthority="ru.volgorobot.vrcatalog.additional.RecentSuggestionProvider"
|
||||
android:searchSuggestSelection=" ?" >
|
||||
</searchable>
|
Loading…
Reference in New Issue
Block a user