Correct a bunch of small things raised by inspection

This commit is contained in:
Matthieu 2020-12-28 20:53:24 +01:00
parent 46c4719a72
commit 86543ee74c
34 changed files with 44 additions and 46 deletions

View File

@ -1,7 +1,6 @@
package com.h.pixeldroid
import android.app.AlertDialog
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
@ -10,12 +9,11 @@ import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.browser.customtabs.CustomTabsIntent
import com.h.pixeldroid.utils.BaseActivity
import com.h.pixeldroid.utils.api.PixelfedAPI
import com.h.pixeldroid.utils.api.objects.*
import com.h.pixeldroid.utils.db.addUser
import com.h.pixeldroid.utils.db.storeInstance
import com.h.pixeldroid.utils.api.objects.*
import com.h.pixeldroid.utils.BaseActivity
import com.h.pixeldroid.utils.hasInternet
import com.h.pixeldroid.utils.normalizeDomain
import com.h.pixeldroid.utils.openUrl
@ -138,7 +136,7 @@ class LoginActivity : BaseActivity() {
appName,"$oauthScheme://$PACKAGE_ID", SCOPE
),
pixelfedAPI.wellKnownNodeInfo(),
BiFunction<Application, NodeInfoJRD, Pair<Application, NodeInfoJRD>> { application, nodeInfoJRD ->
{ application, nodeInfoJRD ->
// we get here when both results have come in:
Pair(application, nodeInfoJRD)
})
@ -246,7 +244,7 @@ class LoginActivity : BaseActivity() {
clientId, clientSecret, "$oauthScheme://$PACKAGE_ID", SCOPE, code,
"authorization_code"
).onErrorReturn { nullToken },
BiFunction<Instance, Token, Pair<Instance, Token>> { instance, token ->
{ instance, token ->
// we get here when all results have come in:
Pair(instance, token)
})

View File

@ -36,8 +36,8 @@ import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
private val TAG = "Post Creation Activity"
private val MORE_PICTURES_REQUEST_CODE = 0xffff
private const val TAG = "Post Creation Activity"
private const val MORE_PICTURES_REQUEST_CODE = 0xffff
class PostCreationActivity : BaseActivity() {

View File

@ -183,7 +183,7 @@ class CameraFragment : Fragment() {
// Bind the CameraProvider to the LifeCycleOwner
val cameraSelector = CameraSelector.Builder().requireLensFacing(lensFacing).build()
val cameraProviderFuture = ProcessCameraProvider.getInstance(requireContext())
cameraProviderFuture.addListener(Runnable {
cameraProviderFuture.addListener({
// CameraProvider
val cameraProvider: ProcessCameraProvider = cameraProviderFuture.get()

View File

@ -575,7 +575,8 @@ class StatusViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
holder.viewComment.text = holder.view.context.getString(R.string.NoCommentsToShow)
} else {
holder.viewComment.apply {
text = "${status?.replies_count} ${holder.view.context.getString(R.string.CommentDisplay)}"
text = holder.view.context.getString(R.string.number_comments)
.format(status?.replies_count)
setOnClickListener {
visibility = View.GONE

View File

@ -2,7 +2,6 @@ package com.h.pixeldroid.profile
import android.content.Intent
import android.graphics.Typeface
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.view.View
@ -14,7 +13,6 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.h.pixeldroid.R
import com.h.pixeldroid.adapters.ProfilePostsRecyclerViewAdapter
import com.h.pixeldroid.utils.api.PixelfedAPI
import com.h.pixeldroid.utils.db.entities.UserDatabaseEntity
import com.h.pixeldroid.utils.api.objects.Account

View File

@ -1,4 +1,4 @@
package com.h.pixeldroid.adapters
package com.h.pixeldroid.profile
import android.content.Intent
import android.view.LayoutInflater

View File

@ -16,7 +16,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.h.pixeldroid.R
import com.h.pixeldroid.adapters.ProfilePostViewHolder
import com.h.pixeldroid.profile.ProfilePostViewHolder
import com.h.pixeldroid.utils.api.PixelfedAPI
import com.h.pixeldroid.utils.api.objects.DiscoverPost
import com.h.pixeldroid.utils.api.objects.DiscoverPosts

View File

@ -11,7 +11,7 @@
android:layout_height="48dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="TODO"
android:contentDescription="@string/profile_picture"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -24,7 +24,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:contentDescription="TODO"
android:contentDescription="@string/mascot_description"
app:srcCompat="@drawable/ic_fred_phone" />
<com.google.android.material.textfield.TextInputLayout

View File

@ -23,7 +23,8 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".70"
android:scaleType="centerInside"/>
android:scaleType="centerInside"
android:contentDescription="@string/image_preview" />
<com.h.pixeldroid.postCreation.photoEdit.NonSwipeableViewPager
android:id="@+id/viewPager"
@ -82,6 +83,7 @@
android:src="@drawable/ic_crop_black_24dp"
app:layout_constraintLeft_toLeftOf="@+id/left_guideline"
app:layout_constraintRight_toRightOf="@+id/right_guideline"
app:layout_constraintBottom_toBottomOf="@+id/bottom_guideline" />
app:layout_constraintBottom_toBottomOf="@+id/bottom_guideline"
android:contentDescription="@string/crop_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -24,7 +24,8 @@
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
tools:srcCompat="@tools:sample/avatars"
android:contentDescription="@string/profile_picture" />
<TextView
android:id="@+id/nbPostsTextView"

View File

@ -11,5 +11,6 @@
android:layout_height="50dp"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:background="@drawable/add_photo_alternate_black_24dp" />
android:background="@drawable/add_photo_alternate_black_24dp"
android:contentDescription="@string/add_photo" />
</com.h.pixeldroid.postCreation.SquareLayout>

View File

@ -45,7 +45,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/notification_type"
tools:src="@drawable/ic_default_user"
android:contentDescription="TODO" />
android:contentDescription="@string/profile_picture" />
<ImageView
android:id="@+id/notification_photo_thumbnail"

View File

@ -38,7 +38,8 @@
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
tools:visibility="visible"
android:contentDescription="@string/post_is_album" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.gridlayout.widget.GridLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
@ -10,8 +11,8 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="28dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:text="#aHashTag" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -16,7 +16,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:scaleType="centerCrop" />
android:scaleType="centerCrop"
android:contentDescription="@string/post_image" />
<ImageView
android:layout_width="30dp"
@ -29,6 +30,7 @@
android:foregroundGravity="center"
android:foregroundTint="#FFFFFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/click_image_edit" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.h.pixeldroid.postCreation.SquareLayout>

View File

@ -124,7 +124,7 @@
app:layout_constraintEnd_toStartOf="@id/reblogger"
app:layout_constraintStart_toEndOf="@id/liker"
app:layout_constraintTop_toTopOf="@id/liker"
/>
android:contentDescription="@string/add_comment" />
<at.connyduck.sparkbutton.SparkButton
android:id="@+id/liker"
@ -258,7 +258,7 @@
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="1"
android:contentDescription="Submit button"
android:contentDescription="@string/submit_comment"
android:src="@drawable/ic_send_blue" />
</LinearLayout>

View File

@ -21,5 +21,5 @@
android:adjustViewBounds="true"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription="Thumbnail of filter" />
android:contentDescription="@string/filter_thumbnail" />
</LinearLayout>

View File

@ -27,7 +27,6 @@
<string name="gallery_button_alt">المعرض</string>
<string name="share_picture">شارِك الصورة…</string>
<string name="NoCommentsToShow">لا توجد تعليقات في هذا المنشور…</string>
<string name="CommentDisplay">لإظهاره…</string>
<string name="connect_to_pixelfed">لِج إلى Pixelfed</string>
<string name="lbl_brightness">السطوع</string>
<string name="image_download_failed">فشل التنزيل ، حاول مجددًا مِن فضلك</string>

View File

@ -34,7 +34,6 @@
<string name="capture_button_alt">Captura</string>
<string name="gallery_button_alt">Galeria</string>
<string name="NoCommentsToShow">No hi ha comentaris en aquesta publicació …</string>
<string name="CommentDisplay">mostrar…</string>
<string name="domain_of_your_instance">Domini de la teva instància</string>
<string name="connect_to_pixelfed">Connectat a Pixelfed</string>
<string name="cw_nsfw_hidden_media_n_click_to_show">CW / NSFW / Imatges ocultes

View File

@ -33,7 +33,6 @@
<string name="capture_button_alt">Erfassen</string>
<string name="gallery_button_alt">Galerie</string>
<string name="share_picture">Foto teilen…</string>
<string name="CommentDisplay">zeigen…</string>
<string name="domain_of_your_instance">Domain Ihrer Instanz</string>
<string name="connect_to_pixelfed">Mit Pixelfed verbinden</string>
<string name="login_connection_required_once">Sie müssen online sein, um das erste Konto hinzuzufügen und um PixelDroid zu verwenden :(</string>

View File

@ -33,7 +33,6 @@
<string name="capture_button_alt">Capturar</string>
<string name="gallery_button_alt">Galería</string>
<string name="NoCommentsToShow">No hay comentarios en esta publicación…</string>
<string name="CommentDisplay">para mostrar…</string>
<string name="domain_of_your_instance">Dominio de tu nodo</string>
<string name="connect_to_pixelfed">Conectar con Pixelfed</string>
<string name="login_connection_required_once">Necesitas estar conectado para poder añadir la primera cuenta y utilizar PixelDroid :(</string>

View File

@ -37,7 +37,6 @@
<string name="cw_nsfw_hidden_media_n_click_to_show">Eduki-abisua / Multimedia ezkutatuta
\n (egin klik erakusteko)</string>
<string name="lbl_brightness">DISTIRA</string>
<string name="CommentDisplay">erakutsi…</string>
<string name="domain_of_your_instance">Zure instantziaren domeinua</string>
<string name="add_account_description">Beste Pixelfed kontu bat gehitu</string>
<string name="add_account_name">Kontua gehitu</string>

View File

@ -33,7 +33,6 @@
<string name="gallery_button_alt">نگارخانه</string>
<string name="share_picture">هم‌رسانی تصویر…</string>
<string name="NoCommentsToShow">نظری روی این مطلب نیست…</string>
<string name="CommentDisplay">برای نمایش…</string>
<string name="domain_of_your_instance">دامنهٔ نمونهٔ شما</string>
<string name="connect_to_pixelfed">اتصال به پیکسل‌فد</string>
<string name="app_name">پیکسل‌دروید</string>

View File

@ -37,7 +37,6 @@
<string name="domain_of_your_instance">Domaine de votre instance</string>
<string name="cw_nsfw_hidden_media_n_click_to_show">CW / NSFW / Media caché
\n(Cliquer pour le montrer)</string>
<string name="CommentDisplay">Montrer…</string>
<string name="login_connection_required_once">Vous devez être connecté à internet pour pouvoir ajouter un compte et utiliser PixelDroid :(</string>
<string name="add_account_description">Ajouter un autre compte Pixelfed</string>
<string name="add_account_name">Ajouter un compte Pixelfed</string>

View File

@ -31,7 +31,6 @@
<string name="share_picture">Compartir foto…</string>
<string name="NoCommentsToShow">Sen comentarios na publicación…</string>
<string name="image_download_failed">Fallou a descarga, inténtao outra vez</string>
<string name="CommentDisplay">amostrar…</string>
<string name="domain_of_your_instance">Dominio da túa instancia</string>
<string name="connect_to_pixelfed">Conectar con Pixelfed</string>
<string name="login_connection_required_once">Debes ter conexión a internet para poder engadir a conta e usar PixelDroid :(</string>

View File

@ -29,7 +29,6 @@
<string name="image_download_success">Immagine scaricata con successo</string>
<string name="NoCommentsToShow">Nessun commento in questo post…</string>
<string name="registration_failed">Impossibile registrare l\'applicazione con questo server</string>
<string name="CommentDisplay">mostrare…</string>
<string name="cw_nsfw_hidden_media_n_click_to_show">CW / NSFW / Media nascosti
\n (cliccaper visualizzare)</string>
<string name="capture_button_alt">Acquisizione</string>

View File

@ -25,7 +25,6 @@
<string name="switch_camera_button_alt">カメラを切り替え</string>
<string name="gallery_button_alt">ギャラリー</string>
<string name="share_picture">画像を共有…</string>
<string name="CommentDisplay">表示する…</string>
<string name="domain_of_your_instance">あなたの参加しているインスタンスのドメイン</string>
<string name="connect_to_pixelfed">Pixelfedに接続</string>
<string name="login_connection_required_once">PixelDroidを利用するにははじめにインターネットにアクセスする必要があります</string>

View File

@ -35,7 +35,6 @@
<string name="switch_camera_button_alt">Van camera wisselen</string>
<string name="gallery_button_alt">Gallerij</string>
<string name="NoCommentsToShow">Geen reacties op dit bericht…</string>
<string name="CommentDisplay">weer te geven…</string>
<string name="domain_of_your_instance">Domein van je instance</string>
<string name="connect_to_pixelfed">Met Pixelfed verbinden</string>
<string name="login_connection_required_once">Je moet met het internet verbonden zijn om je eerste account toe te voegen en PixelDroid te kunnen gebruiken :(</string>

View File

@ -15,7 +15,6 @@
<string name="login_connection_required_once">Você precisa estar conectado para poder adicionar a primeira conta e usar o PixelDroid :(</string>
<string name="connect_to_pixelfed">Conectar-se à Pixelfed</string>
<string name="domain_of_your_instance">Domínio da sua instância</string>
<string name="CommentDisplay">mostrar…</string>
<string name="NoCommentsToShow">Nenhum comentário…</string>
<string name="share_picture">Compartilhar imagem…</string>
<string name="gallery_button_alt">Galeria</string>

View File

@ -22,7 +22,6 @@
<string name="switch_camera_button_alt">Переключить камеру</string>
<string name="gallery_button_alt">Галерея</string>
<string name="NoCommentsToShow">Нет комментариев…</string>
<string name="CommentDisplay">показать…</string>
<string name="domain_of_your_instance">Домен вашего инстанса</string>
<string name="connect_to_pixelfed">Подключение к Pixelfed</string>
<string name="app_name">PixelDroid</string>

View File

@ -35,7 +35,6 @@
<string name="gallery_button_alt">Galleri</string>
<string name="share_picture">Dela bild…</string>
<string name="NoCommentsToShow">Inga kommentarer på detta inlägg…</string>
<string name="CommentDisplay">att visa…</string>
<string name="connect_to_pixelfed">Anslut till Pixelfed</string>
<string name="cw_nsfw_hidden_media_n_click_to_show">CW / NSFW / Dold media
\n(Tryck för att visa)</string>

View File

@ -32,7 +32,6 @@
<string name="switch_camera_button_alt">切换摄像头</string>
<string name="gallery_button_alt">相册</string>
<string name="NoCommentsToShow">这条帖文下没有评论……</string>
<string name="CommentDisplay">显示……</string>
<string name="domain_of_your_instance">实例的域名</string>
<string name="connect_to_pixelfed">连接至 Pixelfed</string>
<string name="share_picture">分享图片……</string>

View File

@ -48,16 +48,21 @@
<string name="description">Description…</string>
<string name="post">post</string>
<string name="add_photo">Add a photo</string>
<string name="post_image">One of the images in the post</string>
<string name="click_image_edit">Click the image to edit it</string>
<!-- Post editing -->
<string name="lbl_brightness">BRIGHTNESS</string>
<string name="lbl_contrast">CONTRAST</string>
<string name="lbl_saturation">SATURATION</string>
<string name="tab_filters">FILTERS</string>
<string name="tab_edit">EDIT</string>
<string name="filter_thumbnail">Thumbnail of filter</string>
<string name="normal_filter">Normal</string>
<string name="busy_dialog_text">Still processing image, wait for that to finish first!</string>
<string name="busy_dialog_ok_button">OK, wait for that.</string>
<string name="crop_result_error">"Couldn't retrieve image after crop"</string>
<string name="image_preview">Preview of the image being edited</string>
<string name="crop_button">Button to crop or rotate the image</string>
<!-- Camera -->
<string name="capture_button_alt">Capture</string>
<string name="switch_camera_button_alt">Switch camera</string>
@ -84,7 +89,10 @@
<string name="comment_error">Comment error!</string>
<string name="comment_posted">"Comment: %1$s posted!"</string>
<string name="comment">Comment</string>
<string name="CommentDisplay"> to show…</string>
<string name="number_comments">%1$s comments</string>
<string name="add_comment">Add a comment</string>
<string name="submit_comment">Submit comment</string>
<string name="post_is_album">This post is an album</string>
<!-- Profile page -->
<string name="nb_posts">"%1$s\nPosts"</string>
<string name="nb_followers">"%1$s\nFollowers"</string>
@ -146,6 +154,6 @@
<string name="language">Language</string>
<string name="help_translate">Help translate PixelDroid to your language:</string>
<string name="issues_contribute">Report issues or contribute to the application:</string>
<string name="mascot_description">Image showing a red panda, Pixelfed\'s mascot, using a phone</string>
</resources>