mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-11-04 00:33:55 +01:00 
			
		
		
		
	cleanup
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
		
							parent
							
								
									2daca3aa98
								
							
						
					
					
						commit
						c89469e208
					
				
					 6 changed files with 5 additions and 17 deletions
				
			
		| 
						 | 
					@ -5,7 +5,6 @@ import androidx.room.Delete
 | 
				
			||||||
import androidx.room.Insert
 | 
					import androidx.room.Insert
 | 
				
			||||||
import androidx.room.OnConflictStrategy
 | 
					import androidx.room.OnConflictStrategy
 | 
				
			||||||
import androidx.room.Query
 | 
					import androidx.room.Query
 | 
				
			||||||
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
 | 
					 | 
				
			||||||
import kotlinx.coroutines.flow.Flow
 | 
					import kotlinx.coroutines.flow.Flow
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Dao
 | 
					@Dao
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +0,0 @@
 | 
				
			||||||
package fr.free.nrw.commons.bookmarks.category
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class BookmarkCategoriesViewModel(
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
package fr.free.nrw.commons.bookmarks.models
 | 
					package fr.free.nrw.commons.bookmarks.category
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import androidx.room.Entity
 | 
					import androidx.room.Entity
 | 
				
			||||||
import androidx.room.PrimaryKey
 | 
					import androidx.room.PrimaryKey
 | 
				
			||||||
| 
						 | 
					@ -6,4 +6,4 @@ import androidx.room.PrimaryKey
 | 
				
			||||||
@Entity(tableName = "bookmarks_categories")
 | 
					@Entity(tableName = "bookmarks_categories")
 | 
				
			||||||
data class BookmarksCategoryModal(
 | 
					data class BookmarksCategoryModal(
 | 
				
			||||||
    @PrimaryKey val categoryName: String
 | 
					    @PrimaryKey val categoryName: String
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -205,7 +205,6 @@ class CategoryDetailsActivity : BaseActivity(),
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            R.id.menu_bookmark_current_category -> {
 | 
					            R.id.menu_bookmark_current_category -> {
 | 
				
			||||||
                //TODO: most likely won't be null
 | 
					 | 
				
			||||||
                categoryName?.let {
 | 
					                categoryName?.let {
 | 
				
			||||||
                    viewModel.onBookmarkClick(categoryName = it)
 | 
					                    viewModel.onBookmarkClick(categoryName = it)
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@ import androidx.lifecycle.ViewModel
 | 
				
			||||||
import androidx.lifecycle.ViewModelProvider
 | 
					import androidx.lifecycle.ViewModelProvider
 | 
				
			||||||
import androidx.lifecycle.viewModelScope
 | 
					import androidx.lifecycle.viewModelScope
 | 
				
			||||||
import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
 | 
					import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
 | 
				
			||||||
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
 | 
					import fr.free.nrw.commons.bookmarks.category.BookmarksCategoryModal
 | 
				
			||||||
import kotlinx.coroutines.flow.MutableStateFlow
 | 
					import kotlinx.coroutines.flow.MutableStateFlow
 | 
				
			||||||
import kotlinx.coroutines.flow.asStateFlow
 | 
					import kotlinx.coroutines.flow.asStateFlow
 | 
				
			||||||
import kotlinx.coroutines.flow.update
 | 
					import kotlinx.coroutines.flow.update
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,6 @@ class CategoryDetailsViewModel(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private fun addBookmark(categoryName: String) {
 | 
					    private fun addBookmark(categoryName: String) {
 | 
				
			||||||
        viewModelScope.launch {
 | 
					        viewModelScope.launch {
 | 
				
			||||||
            // TODO [Parry] view only knows about `name` see if we can have more data
 | 
					 | 
				
			||||||
            val categoryItem = BookmarksCategoryModal(
 | 
					            val categoryItem = BookmarksCategoryModal(
 | 
				
			||||||
                categoryName = categoryName
 | 
					                categoryName = categoryName
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
| 
						 | 
					@ -74,4 +73,4 @@ class CategoryDetailsViewModel(
 | 
				
			||||||
                throw IllegalArgumentException("Unknown class name")
 | 
					                throw IllegalArgumentException("Unknown class name")
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@ import androidx.room.Database
 | 
				
			||||||
import androidx.room.RoomDatabase
 | 
					import androidx.room.RoomDatabase
 | 
				
			||||||
import androidx.room.TypeConverters
 | 
					import androidx.room.TypeConverters
 | 
				
			||||||
import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
 | 
					import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
 | 
				
			||||||
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
 | 
					import fr.free.nrw.commons.bookmarks.category.BookmarksCategoryModal
 | 
				
			||||||
import fr.free.nrw.commons.contributions.Contribution
 | 
					import fr.free.nrw.commons.contributions.Contribution
 | 
				
			||||||
import fr.free.nrw.commons.contributions.ContributionDao
 | 
					import fr.free.nrw.commons.contributions.ContributionDao
 | 
				
			||||||
import fr.free.nrw.commons.customselector.database.NotForUploadStatus
 | 
					import fr.free.nrw.commons.customselector.database.NotForUploadStatus
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue