From fc89193852e1a451ed28303280037ce83e02683a Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:00:05 +0200 Subject: [PATCH 01/18] change var to val in DownloadActivity.kt --- .../java/ch/sdp/vibester/activity/DownloadActivity.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt index 26c4c380c..183855eed 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt @@ -58,9 +58,9 @@ class DownloadActivity : AppCompatActivity() { IntentSwitcher.switch(this, MainActivity::class.java) } - var broadcast = object:BroadcastReceiver() { + val broadcast = object:BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { - var id = intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) + val id = intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) if (id == downloadId) { alert( getString(R.string.download_download_complete), @@ -190,7 +190,7 @@ class DownloadActivity : AppCompatActivity() { * Indicator of if the song already exists or not. */ private fun checkExistingSong(): Boolean { - var existing = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "extract_of_$songName") + val existing = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "extract_of_$songName") return existing.exists() } @@ -199,7 +199,7 @@ class DownloadActivity : AppCompatActivity() { * If the file does not exist, it is created. */ private fun record() { - var records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") + val records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") if (!records.exists()) { records.createNewFile() @@ -213,7 +213,7 @@ class DownloadActivity : AppCompatActivity() { * Order of storage: Track name - artist name - artwork URL - preview URL. */ private fun recordProperties() { - var properties = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "properties.txt") + val properties = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "properties.txt") if (!properties.exists()) { properties.createNewFile() From bb20f9328b4ce0543d1009954398551b4a38591a Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:01:51 +0200 Subject: [PATCH 02/18] inline alert --- .../ch/sdp/vibester/activity/DownloadActivity.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt index 183855eed..2b9b10e0c 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt @@ -86,11 +86,7 @@ class DownloadActivity : AppCompatActivity() { songName = songView.text.toString() if (checkExistingSong()) { - alert( - getString(R.string.download_already_done), - getString(R.string.download_try_different), - songView - ) + alert(getString(R.string.download_already_done), getString(R.string.download_try_different), songView) } else { getAndDownload(songView) } @@ -104,11 +100,7 @@ class DownloadActivity : AppCompatActivity() { songName = song.getTrackName().lowercase() + " - " + song.getArtistName().lowercase() checkPermissionsAndDownload() } catch (e: IllegalArgumentException) { - alert( - getString(R.string.download_unable_to_find), - getString(R.string.download_retry), - songView - ) + alert(getString(R.string.download_unable_to_find), getString(R.string.download_retry), songView) } } From 9502fe009d8e02f818cf9e2eac0448173524aeab Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:02:43 +0200 Subject: [PATCH 03/18] inline alert --- .../main/java/ch/sdp/vibester/activity/DownloadActivity.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt index 2b9b10e0c..6d1b38e0c 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt @@ -62,11 +62,7 @@ class DownloadActivity : AppCompatActivity() { override fun onReceive(context: Context?, intent: Intent?) { val id = intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) if (id == downloadId) { - alert( - getString(R.string.download_download_complete), - getString(R.string.download_try_another), - songNameView - ) + alert(getString(R.string.download_download_complete), getString(R.string.download_try_another), songNameView) } } } From c5f2698963f629f518d0b09c2f0704eee7860334 Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:11:08 +0200 Subject: [PATCH 04/18] inline else statement and remove unnecessary val --- .../sdp/vibester/activity/DownloadActivity.kt | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt index 6d1b38e0c..f56a2864c 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt @@ -83,9 +83,7 @@ class DownloadActivity : AppCompatActivity() { if (checkExistingSong()) { alert(getString(R.string.download_already_done), getString(R.string.download_try_different), songView) - } else { - getAndDownload(songView) - } + } else { getAndDownload(songView) } } } @@ -131,9 +129,7 @@ class DownloadActivity : AppCompatActivity() { if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) { downloadId = startDownload() } - } else { - Toast.makeText(this, getString(R.string.download_permission_denied), Toast.LENGTH_LONG).show() - } + } else { Toast.makeText(this, getString(R.string.download_permission_denied), Toast.LENGTH_LONG).show() } } /** @@ -144,12 +140,8 @@ class DownloadActivity : AppCompatActivity() { Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) { requestPermissions(arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), STORAGE_PERMISSION_CODE) - } else { - downloadId = startDownload() - } - } else { - downloadId = startDownload() - } + } else { downloadId = startDownload() } + } else { downloadId = startDownload() } } /** @@ -166,9 +158,7 @@ class DownloadActivity : AppCompatActivity() { .setAllowedOverRoaming(true) .setDescription("Downloading extract of the song + $songName") .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) - .setDestinationInExternalFilesDir(this, - Environment.DIRECTORY_DOWNLOADS, - "extract_of_$songName") + .setDestinationInExternalFilesDir(this, Environment.DIRECTORY_DOWNLOADS, "extract_of_$songName") val downloader = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager return downloader.enqueue(request) @@ -192,6 +182,7 @@ class DownloadActivity : AppCompatActivity() { if (!records.exists()) { records.createNewFile() } + records.appendText("$songName\n") recordProperties() } @@ -207,11 +198,7 @@ class DownloadActivity : AppCompatActivity() { properties.createNewFile() } - val trackName = song.getTrackName() - val artistName = song.getArtistName() - val artworkURL = song.getArtworkUrl() - val previewURL = song.getPreviewUrl() - properties.appendText("$trackName - $artistName - $artworkURL - $previewURL\n") + properties.appendText("${song.getTrackName()} - ${song.getArtistName()} - ${song.getArtworkUrl()} - ${song.getPreviewUrl()}\n") } fun switchToDeleteSongs(view: View) { From 96ce08b80d56b73aa7379fa8298e7e079e479a2b Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:23:03 +0200 Subject: [PATCH 05/18] rename ImageHelper.kt to Helper.kt and create setReturnToMainListener() --- .../sdp/vibester/activity/DeleteSongsActivity.kt | 6 ++---- .../ch/sdp/vibester/activity/DownloadActivity.kt | 6 ++---- .../sdp/vibester/activity/GameEndingActivity.kt | 6 ++---- .../vibester/activity/profile/ProfileActivity.kt | 4 ++-- .../helper/{ImageHelper.kt => Helper.kt} | 16 +++++++++++++++- .../ch/sdp/vibester/user/UserProfileAdapter.kt | 4 ++-- .../sdp/vibester/user/UserScoreboardAdapter.kt | 6 ++---- 7 files changed, 27 insertions(+), 21 deletions(-) rename app/src/main/java/ch/sdp/vibester/helper/{ImageHelper.kt => Helper.kt} (72%) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt index 2406c3ddb..e2e8a7dfe 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt @@ -14,7 +14,7 @@ import android.view.ViewGroup.LayoutParams.WRAP_CONTENT import android.widget.TextView import android.widget.Toast import ch.sdp.vibester.R -import ch.sdp.vibester.helper.IntentSwitcher +import ch.sdp.vibester.helper.Helper import com.google.android.material.floatingactionbutton.FloatingActionButton import java.io.* /** @@ -28,9 +28,7 @@ class DeleteSongsActivity : AppCompatActivity() { setContentView(R.layout.activity_delete_songs) - findViewById(R.id.delete_returnToMain).setOnClickListener { - IntentSwitcher.switch(this, MainActivity::class.java) - } + Helper().setReturnToMainListener(findViewById(R.id.delete_returnToMain), this) val layout: LinearLayout = findViewById(R.id.delete_songs_linear) generateButtons(layout) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt index f56a2864c..4b585e5c7 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DownloadActivity.kt @@ -18,7 +18,7 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import ch.sdp.vibester.R import ch.sdp.vibester.api.ItunesMusicApi -import ch.sdp.vibester.helper.IntentSwitcher +import ch.sdp.vibester.helper.Helper import ch.sdp.vibester.model.Song import com.google.android.material.floatingactionbutton.FloatingActionButton import okhttp3.OkHttpClient @@ -54,9 +54,7 @@ class DownloadActivity : AppCompatActivity() { downloadListener(songNameView) } - findViewById(R.id.download_returnToMain).setOnClickListener { - IntentSwitcher.switch(this, MainActivity::class.java) - } + Helper().setReturnToMainListener(findViewById(R.id.download_returnToMain), this) val broadcast = object:BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { diff --git a/app/src/main/java/ch/sdp/vibester/activity/GameEndingActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/GameEndingActivity.kt index 997d86b3e..1bd0a6aa0 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/GameEndingActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/GameEndingActivity.kt @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import ch.sdp.vibester.R import ch.sdp.vibester.database.AppPreferences -import ch.sdp.vibester.helper.IntentSwitcher +import ch.sdp.vibester.helper.Helper import ch.sdp.vibester.model.SongListAdapter import com.google.android.material.floatingactionbutton.FloatingActionButton @@ -51,9 +51,7 @@ class GameEndingActivity : AppCompatActivity() { setUpRecyclerView() - findViewById(R.id.end_returnToMain).setOnClickListener { - IntentSwitcher.switch(this, MainActivity::class.java) - } + Helper().setReturnToMainListener(findViewById(R.id.end_returnToMain), this) } private fun setUpRecyclerView() { diff --git a/app/src/main/java/ch/sdp/vibester/activity/profile/ProfileActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/profile/ProfileActivity.kt index 3cf62a9f7..4e5187533 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/profile/ProfileActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/profile/ProfileActivity.kt @@ -17,7 +17,7 @@ import ch.sdp.vibester.activity.MainActivity import ch.sdp.vibester.auth.FireBaseAuthenticator import ch.sdp.vibester.database.DataGetter import ch.sdp.vibester.database.ImageGetter -import ch.sdp.vibester.helper.ImageHelper +import ch.sdp.vibester.helper.Helper import ch.sdp.vibester.helper.IntentSwitcher import ch.sdp.vibester.user.OnItemClickListener import ch.sdp.vibester.user.ProfileFollowingAdapter @@ -135,7 +135,7 @@ open class ProfileActivity : AppCompatActivity(), OnItemClickListener { */ private fun setImage(imageURI: Uri) { val avatar = findViewById(R.id.profile_image_ImageView) - ImageHelper().setImage(imageURI, avatar, imageSize) + Helper().setImage(imageURI, avatar, imageSize) } diff --git a/app/src/main/java/ch/sdp/vibester/helper/ImageHelper.kt b/app/src/main/java/ch/sdp/vibester/helper/Helper.kt similarity index 72% rename from app/src/main/java/ch/sdp/vibester/helper/ImageHelper.kt rename to app/src/main/java/ch/sdp/vibester/helper/Helper.kt index c6ae539bf..6e620bd2f 100644 --- a/app/src/main/java/ch/sdp/vibester/helper/ImageHelper.kt +++ b/app/src/main/java/ch/sdp/vibester/helper/Helper.kt @@ -1,8 +1,11 @@ package ch.sdp.vibester.helper +import android.content.Context import android.graphics.Bitmap import android.net.Uri +import android.view.View import android.widget.ImageView +import ch.sdp.vibester.activity.MainActivity import ch.sdp.vibester.api.BitmapGetterApi import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -10,7 +13,7 @@ import kotlinx.coroutines.async import kotlinx.coroutines.launch import java.util.concurrent.TimeUnit -class ImageHelper { +class Helper { /** * Set the image of imageURI in avatar of given size @@ -35,4 +38,15 @@ class ImageHelper { } } } + + /** + * set up listener for return to main button + * @param btn view of the button + * @param ctx context + */ + fun setReturnToMainListener(btn: View, ctx: Context) { + btn.setOnClickListener { + IntentSwitcher.switch(ctx, MainActivity::class.java) + } + } } \ No newline at end of file diff --git a/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt b/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt index 9628849da..73976249b 100644 --- a/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt +++ b/app/src/main/java/ch/sdp/vibester/user/UserProfileAdapter.kt @@ -12,7 +12,7 @@ import ch.sdp.vibester.auth.FireBaseAuthenticator import ch.sdp.vibester.database.DataGetter import ch.sdp.vibester.database.ImageGetter import ch.sdp.vibester.helper.AdapterHelper -import ch.sdp.vibester.helper.ImageHelper +import ch.sdp.vibester.helper.Helper /** @@ -88,7 +88,7 @@ class UserProfileAdapter constructor( private fun setImage(imageURI: Uri) { val avatar = itemView.findViewById(R.id.search_user_profile_image) - ImageHelper().setImage(imageURI, avatar, imageSize) + Helper().setImage(imageURI, avatar, imageSize) } private fun setFollowBtnListener(user: User) { diff --git a/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt b/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt index b1f3bf12e..6f5731bcd 100644 --- a/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt +++ b/app/src/main/java/ch/sdp/vibester/user/UserScoreboardAdapter.kt @@ -1,6 +1,5 @@ package ch.sdp.vibester.user -import android.graphics.Color import android.net.Uri import android.view.LayoutInflater import android.view.View @@ -11,8 +10,7 @@ import androidx.recyclerview.widget.RecyclerView import ch.sdp.vibester.R import ch.sdp.vibester.database.ImageGetter import ch.sdp.vibester.helper.AdapterHelper -import ch.sdp.vibester.helper.ImageHelper -import ch.sdp.vibester.helper.loadImg +import ch.sdp.vibester.helper.Helper /** * Set users list in recycleView in scoreboard @@ -83,7 +81,7 @@ class UserScoreboardAdapter( private fun setImage(imageURI: Uri) { val avatar = itemView.findViewById(R.id.iv_photo) - ImageHelper().setImage(imageURI, avatar, imageSize) + Helper().setImage(imageURI, avatar, imageSize) } From 0f3a8de540a0f1e023a06eac8dc2a9f74df1b01c Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:24:12 +0200 Subject: [PATCH 06/18] change var to val in DeleteSongsActivity.kt --- .../vibester/activity/DeleteSongsActivity.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt b/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt index e2e8a7dfe..996d24413 100644 --- a/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt +++ b/app/src/main/java/ch/sdp/vibester/activity/DeleteSongsActivity.kt @@ -39,17 +39,17 @@ class DeleteSongsActivity : AppCompatActivity() { * Assigns each button a call to the "deleteDownloadedSong" function as a listener. */ private fun generateButtons(layout: LinearLayout) { - var records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") + val records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") if(!records.exists() || records.length() == 0L) { createNoSongsView(layout) } else { - var reader = BufferedReader(FileReader(records)) + val reader = BufferedReader(FileReader(records)) var currentLine = reader.readLine() var iterator = 0 while(currentLine != null) { - var trimmed = currentLine.trim() + val trimmed = currentLine.trim() if(trimmed.isNotEmpty()) { val deleteButton = createButton(trimmed, iterator, layout) layout.addView(deleteButton) @@ -81,18 +81,18 @@ class DeleteSongsActivity : AppCompatActivity() { * from the text file which keeps track of all downloads. */ private fun deleteDownloadedSong(btn: View, layout: LinearLayout): Boolean { - var records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") - var tempRecords = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "temp.txt") + val records = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "records.txt") + val tempRecords = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "temp.txt") - var recordReader = BufferedReader(FileReader(records)) - var recordWriter = BufferedWriter(FileWriter(tempRecords, true)) + val recordReader = BufferedReader(FileReader(records)) + val recordWriter = BufferedWriter(FileWriter(tempRecords, true)) var currentLine = recordReader.readLine() - var button: Button = btn as Button + val button: Button = btn as Button val buttonText = button.text.toString() while (currentLine != null) { - var trimmed = currentLine.trim() + val trimmed = currentLine.trim() if (trimmed == buttonText) { currentLine = recordReader.readLine() @@ -114,7 +114,7 @@ class DeleteSongsActivity : AppCompatActivity() { records.delete() if (tempRecords.renameTo(records) && removeFromProperties(buttonText)) { layout.removeView(btn) - var songToDelete = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "extract_of_${button.text}") + val songToDelete = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "extract_of_${button.text}") if (songToDelete.delete()) { Toast.makeText(applicationContext, "Song successfully removed!", Toast.LENGTH_LONG).show() return true @@ -129,11 +129,11 @@ class DeleteSongsActivity : AppCompatActivity() { * @param buttonText: Text which contains song name - artist name */ private fun removeFromProperties(buttonText: String): Boolean { - var properties = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "properties.txt") - var tempProp = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "tempProp.txt") + val properties = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "properties.txt") + val tempProp = File(applicationContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "tempProp.txt") - var propReader = BufferedReader(FileReader(properties)) - var propWriter = BufferedWriter(FileWriter(tempProp, true)) + val propReader = BufferedReader(FileReader(properties)) + val propWriter = BufferedWriter(FileWriter(tempProp, true)) var currentLine = propReader.readLine() val buttonSplit = buttonText.trim().split("-") @@ -145,7 +145,7 @@ class DeleteSongsActivity : AppCompatActivity() { * We write every line on a new file except the one which we want to delete, thus we continue if we match. */ while (currentLine != null) { - var trimmed = currentLine.trim() + val trimmed = currentLine.trim() val split = trimmed.split(" - ") if (split[0].trim().lowercase() == buttonSplit[0].trim().lowercase() From 19d11b466da621c8fede0141133bc5a1ab16bcd3 Mon Sep 17 00:00:00 2001 From: jiabaow Date: Tue, 24 May 2022 20:26:07 +0200 Subject: [PATCH 07/18] clean song_item_layout.xml --- app/src/main/res/layout/song_item_layout.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/song_item_layout.xml b/app/src/main/res/layout/song_item_layout.xml index 0c44272b1..6f72b046c 100644 --- a/app/src/main/res/layout/song_item_layout.xml +++ b/app/src/main/res/layout/song_item_layout.xml @@ -11,7 +11,7 @@ android:layout_height="60dp" android:layout_alignParentStart="true" android:layout_marginStart="20dp" - android:textSize="20sp"> + android:textSize="20sp" />