Merge branch 'bug_fixes' into 'master'
Fix some bugs Closes #282 and #281 See merge request pixeldroid/PixelDroid!313
This commit is contained in:
commit
3f90f16fef
@ -60,12 +60,6 @@ class SearchDiscoverFragment : BaseFragment() {
|
|||||||
adapter = DiscoverRecyclerViewAdapter()
|
adapter = DiscoverRecyclerViewAdapter()
|
||||||
recycler.adapter = adapter
|
recycler.adapter = adapter
|
||||||
|
|
||||||
binding.discoverText.setCompoundDrawables(IconicsDrawable(requireContext(), GoogleMaterial.Icon.gmd_explore).apply {
|
|
||||||
sizeDp = 24
|
|
||||||
paddingDp = 20
|
|
||||||
color = IconicsColor.colorRes(R.color.colorDrawing)
|
|
||||||
}, null, null, null)
|
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,5 +49,5 @@ fun storeInstance(db: AppDatabase, nodeInfo: NodeInfo?, instance: Instance? = nu
|
|||||||
)
|
)
|
||||||
} ?: throw IllegalArgumentException("Cannot store instance where both are null")
|
} ?: throw IllegalArgumentException("Cannot store instance where both are null")
|
||||||
|
|
||||||
db.instanceDao().insertInstance(dbInstance)
|
db.instanceDao().insertOrUpdate(dbInstance)
|
||||||
}
|
}
|
@ -1,9 +1,6 @@
|
|||||||
package com.h.pixeldroid.utils.db.dao
|
package com.h.pixeldroid.utils.db.dao
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.*
|
||||||
import androidx.room.Insert
|
|
||||||
import androidx.room.OnConflictStrategy
|
|
||||||
import androidx.room.Query
|
|
||||||
import com.h.pixeldroid.utils.db.entities.InstanceDatabaseEntity
|
import com.h.pixeldroid.utils.db.entities.InstanceDatabaseEntity
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
@ -11,6 +8,19 @@ interface InstanceDao {
|
|||||||
@Query("SELECT * FROM instances")
|
@Query("SELECT * FROM instances")
|
||||||
fun getAll(): List<InstanceDatabaseEntity>
|
fun getAll(): List<InstanceDatabaseEntity>
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
/**
|
||||||
fun insertInstance(instance: InstanceDatabaseEntity)
|
* Insert an instance, if it already exists return -1
|
||||||
|
*/
|
||||||
|
@Insert(onConflict = OnConflictStrategy.IGNORE)
|
||||||
|
fun insertInstance(instance: InstanceDatabaseEntity): Long
|
||||||
|
|
||||||
|
@Update
|
||||||
|
fun updateInstance(instance: InstanceDatabaseEntity)
|
||||||
|
|
||||||
|
@Transaction
|
||||||
|
fun insertOrUpdate(instance: InstanceDatabaseEntity) {
|
||||||
|
if (insertInstance(instance) == -1L) {
|
||||||
|
updateInstance(instance)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
9
app/src/main/res/drawable/explore_24dp.xml
Normal file
9
app/src/main/res/drawable/explore_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12,10.9c-0.61,0 -1.1,0.49 -1.1,1.1s0.49,1.1 1.1,1.1c0.61,0 1.1,-0.49 1.1,-1.1s-0.49,-1.1 -1.1,-1.1zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM14.19,14.19L6,18l3.81,-8.19L18,6l-3.81,8.19z"
|
||||||
|
android:fillColor="@color/colorDrawing"/>
|
||||||
|
</vector>
|
@ -5,7 +5,9 @@
|
|||||||
android:id="@+id/coordinatorLayout"
|
android:id="@+id/coordinatorLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
|
@ -56,7 +56,8 @@
|
|||||||
android:text="@string/discover"
|
android:text="@string/discover"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/errorLayout" />
|
app:layout_constraintTop_toBottomOf="@id/errorLayout"
|
||||||
|
app:drawableStartCompat="@drawable/explore_24dp" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/discoverList"
|
android:id="@+id/discoverList"
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
<item>বাংলা (বাংলাদেশ)</item>
|
<item>বাংলা (বাংলাদেশ)</item>
|
||||||
<item>Català</item>
|
<item>Català</item>
|
||||||
<item>Deutsch</item>
|
<item>Deutsch</item>
|
||||||
<item>Esperanto</item>
|
<item>Español</item>
|
||||||
<item>Euskara</item>
|
<item>Euskara</item>
|
||||||
|
<item>English</item>
|
||||||
<item>فارسی</item>
|
<item>فارسی</item>
|
||||||
<item>Français</item>
|
<item>Français</item>
|
||||||
<item>Gaeilge</item>
|
<item>Gaeilge</item>
|
||||||
@ -42,6 +43,7 @@
|
|||||||
<item>de</item>
|
<item>de</item>
|
||||||
<item>es</item>
|
<item>es</item>
|
||||||
<item>eu</item>
|
<item>eu</item>
|
||||||
|
<item>en</item>
|
||||||
<item>fa</item>
|
<item>fa</item>
|
||||||
<item>fr</item>
|
<item>fr</item>
|
||||||
<item>gl</item>
|
<item>gl</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user