From 5ca958624ef832c5ffe366c6420ca77fd0fda309 Mon Sep 17 00:00:00 2001 From: James Williams Date: Tue, 15 Dec 2020 10:08:48 -0800 Subject: [PATCH 1/7] Removals and additions to make starter branch. --- app/.gitignore | 1 + app/build.gradle | 3 - app/src/main/AndroidManifest.xml | 3 + .../com/example/wordsapp/DetailActivity.kt | 52 +++++++ .../example/wordsapp/DetailListFragment.kt | 88 ----------- .../com/example/wordsapp/LetterAdapter.kt | 16 +- .../java/com/example/wordsapp/MainActivity.kt | 31 ++-- .../java/com/example/wordsapp/WordAdapter.kt | 12 +- .../com/example/wordsapp/WordListFragment.kt | 140 ------------------ app/src/main/res/drawable/ic_grid_layout.xml | 27 ---- .../res/drawable/ic_launcher_background.xml | 19 +-- .../main/res/drawable/ic_linear_layout.xml | 27 ---- ...nt_detail_list.xml => activity_detail.xml} | 6 +- app/src/main/res/layout/activity_main.xml | 27 ++-- .../main/res/layout/fragment_word_list.xml | 30 ---- app/src/main/res/menu/layout_menu.xml | 23 --- app/src/main/res/navigation/nav_graph.xml | 41 ----- app/src/main/res/values/strings.xml | 1 - app/src/main/res/values/themes.xml | 1 - 19 files changed, 92 insertions(+), 456 deletions(-) create mode 100644 app/.gitignore create mode 100644 app/src/main/java/com/example/wordsapp/DetailActivity.kt delete mode 100644 app/src/main/java/com/example/wordsapp/DetailListFragment.kt delete mode 100644 app/src/main/java/com/example/wordsapp/WordListFragment.kt delete mode 100644 app/src/main/res/drawable/ic_grid_layout.xml delete mode 100644 app/src/main/res/drawable/ic_linear_layout.xml rename app/src/main/res/layout/{fragment_detail_list.xml => activity_detail.xml} (91%) delete mode 100644 app/src/main/res/layout/fragment_word_list.xml delete mode 100644 app/src/main/res/menu/layout_menu.xml delete mode 100644 app/src/main/res/navigation/nav_graph.xml diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 5f10d213..489ec986 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,7 +17,6 @@ plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' - id 'androidx.navigation.safeargs.kotlin' } android { @@ -60,6 +59,4 @@ dependencies { implementation "androidx.appcompat:appcompat:$appcompat_version" implementation "com.google.android.material:material:$material_version" implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version" - implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" - implementation "androidx.navigation:navigation-ui-ktx:$nav_version" } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c484b611..de8ddd12 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,6 +24,9 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Words"> + diff --git a/app/src/main/java/com/example/wordsapp/DetailActivity.kt b/app/src/main/java/com/example/wordsapp/DetailActivity.kt new file mode 100644 index 00000000..289b0046 --- /dev/null +++ b/app/src/main/java/com/example/wordsapp/DetailActivity.kt @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ +package com.example.wordsapp + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.wordsapp.databinding.ActivityDetailBinding + + +class DetailActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + // Retrieve a binding object that allows you to refer to views by id name + // Names are converted from snake case to camel case. + // For example, a View with the id word_one is referenced as binding.wordOne + val binding = ActivityDetailBinding.inflate(layoutInflater) + setContentView(binding.root) + + // Retrieve the LETTER from the Intent extras + // intent.extras.getString returns String? (String or null) + // so toString() guarantees that the value will be a String + val letterId = "A" + + val recyclerView = binding.recyclerView + recyclerView.layoutManager = LinearLayoutManager(this) + recyclerView.adapter = WordAdapter(letterId, this) + + // Adds a [DividerItemDecoration] between items + recyclerView.addItemDecoration( + DividerItemDecoration(this, DividerItemDecoration.VERTICAL) + ) + + title = getString(R.string.detail_prefix) + " " + letterId + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/wordsapp/DetailListFragment.kt b/app/src/main/java/com/example/wordsapp/DetailListFragment.kt deleted file mode 100644 index 38f57dcc..00000000 --- a/app/src/main/java/com/example/wordsapp/DetailListFragment.kt +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package com.example.wordsapp - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.fragment.app.Fragment -import androidx.recyclerview.widget.DividerItemDecoration -import androidx.recyclerview.widget.LinearLayoutManager -import com.example.wordsapp.databinding.FragmentDetailListBinding - -/** - * Displays a [RecyclerView] of words with search buttons to look them up. - */ -class DetailListFragment : Fragment() { - private lateinit var letterId: String - - private var _binding: FragmentDetailListBinding? = null - - // This property is only valid between onCreateView and - // onDestroyView. - private val binding get() = _binding!! - - - /** - * Provides global access to these variables from anywhere in the app - * via DetailListFragment. without needing to create - * a DetailListFragment instance. - */ - companion object { - val LETTER = "letter" - val SEARCH_PREFIX = "https://www.google.com/search?q=" - } - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - // Retrieve the LETTER from the Fragment arguments - arguments?.let { - letterId = it.getString(LETTER).toString() - } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - // Retrieve and inflate the layout for this fragment - _binding = FragmentDetailListBinding.inflate(inflater, container, false) - val view = binding.root - return view - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - val recyclerView = binding.recyclerView - recyclerView.layoutManager = LinearLayoutManager(requireContext()) - recyclerView.adapter = WordAdapter(letterId, requireContext()) - - // Adds a [DividerItemDecoration] between items - recyclerView.addItemDecoration( - DividerItemDecoration(context, DividerItemDecoration.VERTICAL) - ) - } - - /** - * Frees the binding object when the Fragment is destroyed. - */ - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/wordsapp/LetterAdapter.kt b/app/src/main/java/com/example/wordsapp/LetterAdapter.kt index 54d09d35..ef68d862 100644 --- a/app/src/main/java/com/example/wordsapp/LetterAdapter.kt +++ b/app/src/main/java/com/example/wordsapp/LetterAdapter.kt @@ -22,7 +22,6 @@ import android.view.ViewGroup import android.view.accessibility.AccessibilityNodeInfo import android.widget.Button import androidx.annotation.RequiresApi -import androidx.navigation.findNavController import androidx.recyclerview.widget.RecyclerView /** @@ -50,9 +49,8 @@ class LetterAdapter : */ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LetterViewHolder { val layout = LayoutInflater - .from(parent.context) - .inflate(R.layout.item_view, parent, false) - + .from(parent.context) + .inflate(R.layout.item_view, parent, false) // Setup custom accessibility delegate to set the text read layout.accessibilityDelegate = Accessibility return LetterViewHolder(layout) @@ -64,16 +62,6 @@ class LetterAdapter : override fun onBindViewHolder(holder: LetterViewHolder, position: Int) { val item = list.get(position) holder.button.text = item.toString() - - // Assigns a [OnClickListener] to the button contained in the [ViewHolder] - holder.button.setOnClickListener { - // Create an action from WordList to DetailList - // using the required arguments - val action = WordListFragmentDirections - .actionWordListToDetailList(letter = holder.button.text.toString()) - // Navigate using that action - holder.view.findNavController().navigate(action) - } } // Setup custom accessibility delegate to set the text read with diff --git a/app/src/main/java/com/example/wordsapp/MainActivity.kt b/app/src/main/java/com/example/wordsapp/MainActivity.kt index 120761d3..1b503795 100644 --- a/app/src/main/java/com/example/wordsapp/MainActivity.kt +++ b/app/src/main/java/com/example/wordsapp/MainActivity.kt @@ -17,33 +17,26 @@ package com.example.wordsapp import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import androidx.navigation.NavController -import androidx.navigation.fragment.NavHostFragment -import androidx.navigation.ui.setupActionBarWithNavController +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.wordsapp.databinding.ActivityMainBinding /** - * Main Activity and entry point for the app. + * Main Activity and entry point for the app. Displays a RecyclerView of letters. */ class MainActivity : AppCompatActivity() { - private lateinit var navController: NavController + private lateinit var recyclerView: RecyclerView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - // Get the navigation host fragment from this Activity - val navHostFragment = supportFragmentManager - .findFragmentById(R.id.nav_host_fragment) as NavHostFragment - // Instantiate the navController using the NavHostFragment - navController = navHostFragment.navController - // Make sure actions in the ActionBar get propagated to the NavController - setupActionBarWithNavController(navController) - } + val binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) - /** - * Enables back button support. Simply navigates one element up on the stack. - */ - override fun onSupportNavigateUp(): Boolean { - return navController.navigateUp() || super.onSupportNavigateUp() + recyclerView = binding.recyclerView + // Sets the LinearLayoutManager of the recyclerview + recyclerView.layoutManager = LinearLayoutManager(this) + recyclerView.adapter = LetterAdapter() } + } diff --git a/app/src/main/java/com/example/wordsapp/WordAdapter.kt b/app/src/main/java/com/example/wordsapp/WordAdapter.kt index 4ef6f041..9322bcb2 100644 --- a/app/src/main/java/com/example/wordsapp/WordAdapter.kt +++ b/app/src/main/java/com/example/wordsapp/WordAdapter.kt @@ -16,8 +16,6 @@ package com.example.wordsapp import android.content.Context -import android.content.Intent -import android.net.Uri import android.os.Build import android.view.LayoutInflater import android.view.View @@ -28,7 +26,7 @@ import androidx.annotation.RequiresApi import androidx.recyclerview.widget.RecyclerView /** - * Adapter for the [RecyclerView] in [DetailListFragment]. + * Adapter for the [RecyclerView] in [DetailActivity]. */ class WordAdapter(private val letterId: String, context: Context) : RecyclerView.Adapter() { @@ -68,6 +66,7 @@ class WordAdapter(private val letterId: String, context: Context) : // Setup custom accessibility delegate to set the text read layout.accessibilityDelegate = Accessibility + return WordViewHolder(layout) } @@ -83,14 +82,7 @@ class WordAdapter(private val letterId: String, context: Context) : // Set the text of the WordViewHolder holder.button.text = item - // Assigns a [OnClickListener] to the button contained in the [ViewHolder] - holder.button.setOnClickListener { - val queryUrl: Uri = Uri.parse("${DetailListFragment.SEARCH_PREFIX}${item}") - val intent = Intent(Intent.ACTION_VIEW, queryUrl) - context.startActivity(intent) - } } - // Setup custom accessibility delegate to set the text read with // an accessibility service companion object Accessibility : View.AccessibilityDelegate() { diff --git a/app/src/main/java/com/example/wordsapp/WordListFragment.kt b/app/src/main/java/com/example/wordsapp/WordListFragment.kt deleted file mode 100644 index dfd25f42..00000000 --- a/app/src/main/java/com/example/wordsapp/WordListFragment.kt +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package com.example.wordsapp - -import android.os.Bundle -import android.view.* -import androidx.core.content.ContextCompat -import androidx.fragment.app.Fragment -import androidx.recyclerview.widget.GridLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.example.wordsapp.databinding.FragmentWordListBinding - -/** - * Entry fragment for the app. Displays a [RecyclerView] of letters. - */ -class WordListFragment : Fragment() { - private var _binding: FragmentWordListBinding? = null - - // This property is only valid between onCreateView and - // onDestroyView. - private val binding get() = _binding!! - - private lateinit var recyclerView: RecyclerView - // Keeps track of which LayoutManager is in use for the [RecyclerView] - private var isLinearLayoutManager = true - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setHasOptionsMenu(true) - } - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - // Retrieve and inflate the layout for this fragment - _binding = FragmentWordListBinding.inflate(inflater, container, false) - val view = binding.root - return view - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - recyclerView = binding.recyclerView - // Sets the LayoutManager of the recyclerview - // On the first run of the app, it will be LinearLayoutManager - chooseLayout() - } - - /** - * Sets the LayoutManager for the [RecyclerView] based on the desired orientation of the list. - * - * Notice that because the enclosing class has changed from an Activity to a Fragment, - * the signature of the LayoutManagers has to slightly change. - */ - private fun chooseLayout() { - if (isLinearLayoutManager) { - recyclerView.layoutManager = LinearLayoutManager(context) - } else { - recyclerView.layoutManager = GridLayoutManager(context, 4) - } - recyclerView.adapter = LetterAdapter() - } - - private fun setIcon(menuItem: MenuItem?) { - if (menuItem == null) - return - - // Set the drawable for the menu icon based on which LayoutManager is currently in use - - // An if-clause can be used on the right side of an assignment if all paths return a value. - // The following code is equivalent to - // val context = this.requireContext() - // if (isLinearLayoutManager) - // menu.icon = ContextCompat.getDrawable(context, R.drawable.ic_grid_layout) - // else menu.icon = ContextCompat.getDrawable(context, R.drawable.ic_linear_layout) - menuItem.icon = - if (isLinearLayoutManager) - ContextCompat.getDrawable(this.requireContext(), R.drawable.ic_grid_layout) - else ContextCompat.getDrawable(this.requireContext(), R.drawable.ic_linear_layout) - } - - /** - * Initializes the [Menu] to be used with the current [Activity] - * - * The signature of this function has also changed slightly when changing from - * an Activity to a Fragment - */ - override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - inflater.inflate(R.menu.layout_menu, menu) - - val layoutButton = menu.findItem(R.id.action_switch_layout) - // Calls code to set the icon based on the LinearLayoutManager of the RecyclerView - setIcon(layoutButton) - } - - /** - * Determines how to handle interactions with the selected [MenuItem] - */ - override fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.action_switch_layout -> { - // Sets isLinearLayoutManager (a Boolean) to the opposite value - isLinearLayoutManager = !isLinearLayoutManager - // Sets layout and icon - chooseLayout() - setIcon(item) - - return true - } - // Otherwise, do nothing and use the core event handling - - // when clauses require that all possible paths be accounted for explicitly, - // for instance both the true and false cases if the value is a Boolean, - // or an else to catch all unhandled cases. - else -> super.onOptionsItemSelected(item) - } - } - - /** - * Frees the binding object when the Fragment is destroyed. - */ - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } -} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_grid_layout.xml b/app/src/main/res/drawable/ic_grid_layout.xml deleted file mode 100644 index 60a42149..00000000 --- a/app/src/main/res/drawable/ic_grid_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index 2ed32296..eec440af 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -15,14 +15,11 @@ limitations under the License. --> - - - - \ No newline at end of file + android:width="108.3dp" + android:height="108.3dp" + android:viewportWidth="108.3" + android:viewportHeight="108.3"> + + diff --git a/app/src/main/res/drawable/ic_linear_layout.xml b/app/src/main/res/drawable/ic_linear_layout.xml deleted file mode 100644 index a01e25a9..00000000 --- a/app/src/main/res/drawable/ic_linear_layout.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/fragment_detail_list.xml b/app/src/main/res/layout/activity_detail.xml similarity index 91% rename from app/src/main/res/layout/fragment_detail_list.xml rename to app/src/main/res/layout/activity_detail.xml index d9482de3..67b295a5 100644 --- a/app/src/main/res/layout/fragment_detail_list.xml +++ b/app/src/main/res/layout/activity_detail.xml @@ -18,7 +18,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".DetailListFragment"> + tools:context=".DetailActivity"> + tools:listitem="@layout/word_item_view" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index fc5bf299..884928d8 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,4 @@ - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_word_list.xml b/app/src/main/res/layout/fragment_word_list.xml deleted file mode 100644 index 7b60a5c1..00000000 --- a/app/src/main/res/layout/fragment_word_list.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/layout_menu.xml b/app/src/main/res/menu/layout_menu.xml deleted file mode 100644 index 43b11cc7..00000000 --- a/app/src/main/res/menu/layout_menu.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml deleted file mode 100644 index 03a34660..00000000 --- a/app/src/main/res/navigation/nav_graph.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 241a1c4b..b3e4004c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,5 +20,4 @@ Switch Layout Look up word in a Browser Search Show Stored Words - Words That Start With {letter} \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 9973e0d6..d4dac5e4 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -22,7 +22,6 @@ @color/teal_900 @color/white - @color/blue_200 @color/blue_700 @color/black From 1c3bcc3b42a46fdec4e01ade6c93f5994ba8a129 Mon Sep 17 00:00:00 2001 From: Caren Chang Date: Fri, 5 Nov 2021 11:06:32 -0700 Subject: [PATCH 2/7] Fix reference to incorrect listItem layout --- .gitignore | 42 +++++++++++++++++++++ app/src/main/res/layout/activity_detail.xml | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..260192c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +*/.gitignore +.gradle +.DS_Store + +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/ +out/ +gen/ + +# Libraries used by the app +/libs + +# Build stuff (auto-generated by android update project ...) +build.xml +ant.properties +local.properties +project.properties + +# Eclipse project files +.classpath +.project + +# idea project files +.idea/ +.idea/.name +*.iml +*.ipr +*.iws + +# Gradle-based build +build/ + diff --git a/app/src/main/res/layout/activity_detail.xml b/app/src/main/res/layout/activity_detail.xml index 67b295a5..93074c8e 100644 --- a/app/src/main/res/layout/activity_detail.xml +++ b/app/src/main/res/layout/activity_detail.xml @@ -26,6 +26,6 @@ android:layout_height="match_parent" android:clipToPadding="false" android:padding="16dp" - tools:listitem="@layout/word_item_view" /> + tools:listitem="@layout/item_view" /> From 88c432559e85de73ca9f878e56093f195a7464c7 Mon Sep 17 00:00:00 2001 From: osuleymanova <86437155+osuleymanova@users.noreply.github.com> Date: Wed, 16 Mar 2022 14:45:40 -0700 Subject: [PATCH 3/7] Bump versions Updated: Kotlin version Gradle and AGP versions SDK versions libraries numbers versions buildToolsVersion "30.0.2" line removed jcenter() replaced with mavenCentral() android:exported="true" set up in Manifest --- app/build.gradle | 5 ++--- app/src/main/AndroidManifest.xml | 3 ++- build.gradle | 18 +++++++++--------- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 489ec986..c727e6f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,13 +20,12 @@ plugins { } android { - compileSdkVersion 30 - buildToolsVersion "30.0.2" + compileSdkVersion 32 defaultConfig { applicationId "com.example.wordsapp" minSdkVersion 19 - targetSdkVersion 30 + targetSdkVersion 32 versionCode 1 versionName "1.0" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index de8ddd12..8c90bcc6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -27,7 +27,8 @@ - + diff --git a/build.gradle b/build.gradle index 7116699b..ac62d83c 100644 --- a/build.gradle +++ b/build.gradle @@ -16,19 +16,19 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - appcompat_version = "1.2.0" - constraintlayout_version = "2.0.2" - core_ktx_version = "1.3.2" - kotlin_version = "1.3.72" - material_version = "1.2.1" - nav_version = "2.3.1" + appcompat_version = "1.4.1" + constraintlayout_version = "2.1.3" + core_ktx_version = "1.7.0" + kotlin_version = "1.6.10" + material_version = "1.6.0-alpha03" + nav_version = "2.4.1" } repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" @@ -40,7 +40,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4f04f629..03b1f545 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip From 82b03419be16d0802f7e5f9a3dcb50b07a9dbe2e Mon Sep 17 00:00:00 2001 From: osuleymanova <86437155+osuleymanova@users.noreply.github.com> Date: Fri, 10 Jun 2022 16:21:07 -0700 Subject: [PATCH 4/7] Versions update --- app/build.gradle | 1 - build.gradle | 14 +++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c727e6f4..5daa29f3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,7 +53,6 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "androidx.core:core-ktx:$core_ktx_version" implementation "androidx.appcompat:appcompat:$appcompat_version" implementation "com.google.android.material:material:$material_version" diff --git a/build.gradle b/build.gradle index ac62d83c..8bbc6374 100644 --- a/build.gradle +++ b/build.gradle @@ -16,19 +16,19 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - appcompat_version = "1.4.1" - constraintlayout_version = "2.1.3" - core_ktx_version = "1.7.0" - kotlin_version = "1.6.10" - material_version = "1.6.0-alpha03" - nav_version = "2.4.1" + appcompat_version = "1.4.2" + constraintlayout_version = "2.1.4" + core_ktx_version = "1.8.0" + kotlin_version = "1.6.21" + material_version = "1.7.0-alpha02" + nav_version = "2.4.2" } repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 03b1f545..25e8b907 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip From 6b98d4e59c8c64562739a772ed53fa6fabe26689 Mon Sep 17 00:00:00 2001 From: osuleymanova <86437155+osuleymanova@users.noreply.github.com> Date: Mon, 13 Jun 2022 16:48:57 -0700 Subject: [PATCH 5/7] Kotlin version update --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8bbc6374..5e8ed428 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { appcompat_version = "1.4.2" constraintlayout_version = "2.1.4" core_ktx_version = "1.8.0" - kotlin_version = "1.6.21" + kotlin_version = "1.7.0" material_version = "1.7.0-alpha02" nav_version = "2.4.2" } From ffcc93c2f62864a195c59c7172597f81e84f3610 Mon Sep 17 00:00:00 2001 From: schordas Date: Wed, 28 Sep 2022 14:14:47 -0700 Subject: [PATCH 6/7] update deps, refactor overloads --- app/build.gradle | 4 ++-- app/src/main/java/com/example/wordsapp/LetterAdapter.kt | 8 ++++---- app/src/main/java/com/example/wordsapp/WordAdapter.kt | 8 ++++---- build.gradle | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5daa29f3..b219687e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,12 +20,12 @@ plugins { } android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { applicationId "com.example.wordsapp" minSdkVersion 19 - targetSdkVersion 32 + targetSdkVersion 33 versionCode 1 versionName "1.0" diff --git a/app/src/main/java/com/example/wordsapp/LetterAdapter.kt b/app/src/main/java/com/example/wordsapp/LetterAdapter.kt index ef68d862..ff4fff26 100644 --- a/app/src/main/java/com/example/wordsapp/LetterAdapter.kt +++ b/app/src/main/java/com/example/wordsapp/LetterAdapter.kt @@ -69,21 +69,21 @@ class LetterAdapter : companion object Accessibility : View.AccessibilityDelegate() { @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun onInitializeAccessibilityNodeInfo( - host: View?, - info: AccessibilityNodeInfo? + host: View, + info: AccessibilityNodeInfo ) { super.onInitializeAccessibilityNodeInfo(host, info) // With `null` as the second argument to [AccessibilityAction], the // accessibility service announces "double tap to activate". // If a custom string is provided, // it announces "double tap to ". - val customString = host?.context?.getString(R.string.look_up_words) + val customString = host.context?.getString(R.string.look_up_words) val customClick = AccessibilityNodeInfo.AccessibilityAction( AccessibilityNodeInfo.ACTION_CLICK, customString ) - info?.addAction(customClick) + info.addAction(customClick) } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/wordsapp/WordAdapter.kt b/app/src/main/java/com/example/wordsapp/WordAdapter.kt index 9322bcb2..22560d11 100644 --- a/app/src/main/java/com/example/wordsapp/WordAdapter.kt +++ b/app/src/main/java/com/example/wordsapp/WordAdapter.kt @@ -88,21 +88,21 @@ class WordAdapter(private val letterId: String, context: Context) : companion object Accessibility : View.AccessibilityDelegate() { @RequiresApi(Build.VERSION_CODES.LOLLIPOP) override fun onInitializeAccessibilityNodeInfo( - host: View?, - info: AccessibilityNodeInfo? + host: View, + info: AccessibilityNodeInfo ) { super.onInitializeAccessibilityNodeInfo(host, info) // With `null` as the second argument to [AccessibilityAction], the // accessibility service announces "double tap to activate". // If a custom string is provided, // it announces "double tap to ". - val customString = host?.context?.getString(R.string.look_up_word) + val customString = host.context?.getString(R.string.look_up_word) val customClick = AccessibilityNodeInfo.AccessibilityAction( AccessibilityNodeInfo.ACTION_CLICK, customString ) - info?.addAction(customClick) + info.addAction(customClick) } } } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5e8ed428..b5bd7c0e 100644 --- a/build.gradle +++ b/build.gradle @@ -21,14 +21,14 @@ buildscript { core_ktx_version = "1.8.0" kotlin_version = "1.7.0" material_version = "1.7.0-alpha02" - nav_version = "2.4.2" + nav_version = "2.5.2" } repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:7.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" From 0f3127a6a73eabeb5b93c192e4a3f7868c77ece5 Mon Sep 17 00:00:00 2001 From: schordas Date: Fri, 30 Sep 2022 10:56:04 -0700 Subject: [PATCH 7/7] update deps --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b5bd7c0e..ce25e531 100644 --- a/build.gradle +++ b/build.gradle @@ -16,10 +16,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - appcompat_version = "1.4.2" + appcompat_version = "1.5.1" constraintlayout_version = "2.1.4" - core_ktx_version = "1.8.0" - kotlin_version = "1.7.0" + core_ktx_version = "1.9.0" + kotlin_version = "1.7.10" material_version = "1.7.0-alpha02" nav_version = "2.5.2" }