diff --git a/README.md b/README.md index 741c20c..6da8bbc 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,12 @@ Based on your IDE you can import library in one of the following ways Gradle: ```groovy -debugCompile 'com.ashokvarma.android:sqlite-manager:1.2.1' -releaseCompile 'com.ashokvarma.android:sqlite-manager-no-op:1.2.1' +debugCompile 'com.ashokvarma.android:sqlite-manager:1.3.0' +releaseCompile 'com.ashokvarma.android:sqlite-manager-no-op:1.3.0' ``` If you want this in library in production also then try this : ```groovy -compile 'com.ashokvarma.android:sqlite-manager:1.2.1' +compile 'com.ashokvarma.android:sqlite-manager:1.3.0' ``` @@ -35,14 +35,14 @@ or grab via Maven: com.ashokvarma.android sqlite-manager - 1.2.1 + 1.3.0 pom ``` or Ivy: ```xml - + ``` @@ -155,5 +155,5 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` -[mavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/sqlite-manager/1.2.1/sqlite-manager-1.2.1.aar +[mavenAarDownload]: https://repo1.maven.org/maven2/com/ashokvarma/android/sqlite-manager/1.3.0/sqlite-manager-1.3.0.aar [googlePlayStoreLink]: https://play.google.com/store/apps/details?id=com.ashokvarma.sqlitemanager.sample diff --git a/build.gradle b/build.gradle index 0559861..7294de4 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' @@ -32,14 +32,14 @@ task clean(type: Delete) { ext { minSdkVersion = 14 - targetSdkVersion = 27 - compileSdkVersion = 27 - buildToolsVersion = '27.0.3' + targetSdkVersion = 28 + compileSdkVersion = 28 + buildToolsVersion = '28.0.3' - supportLibVersion = '27.1.1' + supportLibVersion = '28.0.0' - roomDbVersion = "1.0.0" + roomDbVersion = "1.1.1" - LIBRARY_VERSION_NAME = "1.2.2" - LIBRARY_VERSION_CODE = 16 + LIBRARY_VERSION_NAME = "1.3.0" + LIBRARY_VERSION_CODE = 17 } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e7c0ca1..af37c54 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jun 04 11:32:24 IST 2018 +#Sat Oct 27 07:54:49 IST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/sample/build.gradle b/sample/build.gradle index dea8ec0..a3fe1c1 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -39,7 +39,7 @@ dependencies { }) implementation "com.android.support:appcompat-v7:$supportLibVersion" - implementation 'com.android.support.constraint:constraint-layout:1.0.2' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' //Third party database ORM's implementation "android.arch.persistence.room:runtime:${rootProject.roomDbVersion}" diff --git a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerActivity.java b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerActivity.java index 0b60ebd..6b5bbd7 100644 --- a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerActivity.java +++ b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerActivity.java @@ -69,22 +69,22 @@ protected void onCreate(Bundle savedInstanceState) { mSqliteManagerPresenter = new SqliteManagerPresenter(SqliteManager.mSqliteDataRetriever, getIntent().getStringExtra(CSV_FILE_SHARE_AUTHORITY)); mSqliteManagerParent = findViewById(R.id.sqlite_manager_parent); - mTableSelectionSpinner = (AppCompatSpinner) findViewById(R.id.sqlite_manager_table_selection_spinner); + mTableSelectionSpinner = findViewById(R.id.sqlite_manager_table_selection_spinner); mErrorLayout = findViewById(R.id.sqlite_manager_error_layout); mTableLayout = findViewById(R.id.sqlite_manager_table_layout); - mColumnNameView = (ColumnNameView) findViewById(R.id.sqlite_manager_table_layout_header); - mErrorLayoutText = (TextView) findViewById(R.id.sqlite_manager_error_layout_text); - mTableLayoutRecyclerView = (RecyclerView) findViewById(R.id.sqlite_manager_table_layout_recycler_view); + mColumnNameView = findViewById(R.id.sqlite_manager_table_layout_header); + mErrorLayoutText = findViewById(R.id.sqlite_manager_error_layout_text); + mTableLayoutRecyclerView = findViewById(R.id.sqlite_manager_table_layout_recycler_view); mActionCustomQuery = findViewById(R.id.sqlite_manager_action_custom_query); - mSqliteManagerAddFab = (FloatingActionButton) findViewById(R.id.sqlite_manager_add_fab); + mSqliteManagerAddFab = findViewById(R.id.sqlite_manager_add_fab); mTableSelectionContainer = findViewById(R.id.sqlite_manager_table_selection_container); mCustomQueryContainer = findViewById(R.id.sqlite_manager_custom_query_container); - mCustomQueryText = (TextView) findViewById(R.id.sqlite_manager_custom_query_text); - mCustomQueryEdit = (ImageView) findViewById(R.id.sqlite_manager_custom_query_edit); - mCustomQueryClear = (ImageView) findViewById(R.id.sqlite_manager_custom_query_clear); + mCustomQueryText = findViewById(R.id.sqlite_manager_custom_query_text); + mCustomQueryEdit = findViewById(R.id.sqlite_manager_custom_query_edit); + mCustomQueryClear = findViewById(R.id.sqlite_manager_custom_query_clear); - mToolbar = (Toolbar) findViewById(R.id.sqlite_manager_toolbar); + mToolbar = findViewById(R.id.sqlite_manager_toolbar); setSupportActionBar(mToolbar); mTableRecyclerAdapter = new TableRecyclerAdapter(null); @@ -185,7 +185,7 @@ public void showCustomQueryDialog(String previousCustomQuery) { LayoutInflater inflater = this.getLayoutInflater(); final View dialogView = inflater.inflate(R.layout.sqlite_manager_custom_query_dialog, null); - final TextInputEditText customQueryEditText = (TextInputEditText) dialogView.findViewById(R.id.sqlite_manager_custom_query_edit_text); + final TextInputEditText customQueryEditText = dialogView.findViewById(R.id.sqlite_manager_custom_query_edit_text); customQueryEditText.setText(previousCustomQuery); new AlertDialog @@ -214,16 +214,16 @@ public void showAddEditRowDialog(final boolean isEdit, final String tableName, f final View dialogView = inflater.inflate(R.layout.sqlite_manager_add_edit_dialog_container, null); - LinearLayout linearLayout = (LinearLayout) dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_container); - Button deleteButton = (Button) dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_delete); - Button cancelButton = (Button) dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_cancel); - Button updateButton = (Button) dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_update); + LinearLayout linearLayout = dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_container); + Button deleteButton = dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_delete); + Button cancelButton = dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_cancel); + Button updateButton = dialogView.findViewById(R.id.sqlite_manager_add_edit_dialog_update); int index = 0; for (String currentColumnName : tableColumnNames) { View columnView = inflater.inflate(R.layout.sqlite_manager_add_edit_dialog_item, null); ((TextInputLayout) columnView.findViewById(R.id.sqlite_manager_add_edit_dialog_text_input_layout)).setHint(currentColumnName); - TextInputEditText currentInputEditText = (TextInputEditText) columnView.findViewById(R.id.sqlite_manager_add_edit_dialog_edit_text); + TextInputEditText currentInputEditText = columnView.findViewById(R.id.sqlite_manager_add_edit_dialog_edit_text); editTextViews.add(currentInputEditText); linearLayout.addView(columnView); if (oldColumnValues != null && oldColumnValues.get(index) != null) { @@ -286,7 +286,7 @@ public void onClick(View v) { @Override public void setSpinnerAdapter(ArrayList tableNames) { - ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, tableNames); + ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, tableNames); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mTableSelectionSpinner.setAdapter(adapter); } diff --git a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerPresenter.java b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerPresenter.java index 7d41811..14d3737 100644 --- a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerPresenter.java +++ b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteManagerPresenter.java @@ -249,7 +249,7 @@ void updateRow(String tableName, String[] tableColumnNames, SparseArray columnIndex++; if (!TextUtils.isEmpty(currentColumnValue)) { Object oldColumnValue = oldColumnValues.get(columnIndex); - if (oldColumnValue != null && oldColumnValue instanceof byte[]) { + if (oldColumnValue instanceof byte[]) { if (!(Arrays.toString((byte[]) oldColumnValue)).equalsIgnoreCase(currentColumnValue)) { // old and current value not equal getView().informErrorToUser(R.string.sqlite_manager_blob_not_supported); diff --git a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteResponseData.java b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteResponseData.java index aabefca..340d7bc 100644 --- a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteResponseData.java +++ b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/SqliteResponseData.java @@ -50,7 +50,7 @@ List> getColumnIndexToValuesArray() { return mColumnIndexToValuesArray; } - public boolean isQuerySuccess() { + boolean isQuerySuccess() { return mQuerySuccess; } diff --git a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/TableRecyclerAdapter.java b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/TableRecyclerAdapter.java index bc02b1b..014af1b 100644 --- a/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/TableRecyclerAdapter.java +++ b/sqlite-manager/src/main/java/com/ashokvarma/sqlitemanager/TableRecyclerAdapter.java @@ -1,5 +1,6 @@ package com.ashokvarma.sqlitemanager; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.util.SparseArray; @@ -36,17 +37,18 @@ void setData(List> mColumnIndexToValuesArray) { notifyDataSetChanged(); } - public void setListener(Listener listener) { + void setListener(Listener listener) { this.mListener = listener; } + @NonNull @Override - public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new ViewHolder(new RowView(parent.getContext(), viewType)); } @Override - public void onBindViewHolder(ViewHolder holder, int position) { + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { holder.mRowView.setData(mColumnIndexToValuesArray.get(position)); }