1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-08 12:02:33 +01:00

Move components

This commit is contained in:
Allan Wang 2023-06-20 23:28:24 -07:00
parent 37f53e35f2
commit 36a38deb10
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
8 changed files with 12 additions and 11 deletions

View File

@ -20,7 +20,7 @@ import android.app.Activity
import android.app.Application
import android.os.Bundle
import com.google.common.flogger.FluentLogger
import com.pitchedapps.frost.hilt.FrostComponents
import com.pitchedapps.frost.components.FrostComponents
import com.pitchedapps.frost.webview.injection.FrostJsInjectors
import com.pitchedapps.frost.webview.injection.assets.JsAssets
import dagger.hilt.android.HiltAndroidApp

View File

@ -14,11 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.pitchedapps.frost.hilt
package com.pitchedapps.frost.components
import com.pitchedapps.frost.components.Core
import com.pitchedapps.frost.components.FrostDataStore
import com.pitchedapps.frost.components.UseCases
import javax.inject.Inject
import javax.inject.Singleton

View File

@ -16,7 +16,7 @@
*/
package com.pitchedapps.frost.components
import com.pitchedapps.frost.components.usecases.HomeTabsUseCases
import com.pitchedapps.frost.web.usecases.HomeTabsUseCases
import javax.inject.Inject
import javax.inject.Singleton

View File

@ -21,7 +21,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.pitchedapps.frost.FrostApp
import com.pitchedapps.frost.hilt.FrostComponents
import com.pitchedapps.frost.components.FrostComponents
/** Launches new activities. */
inline fun <reified T : Activity> Context.launchActivity(

View File

@ -21,10 +21,10 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import com.pitchedapps.frost.components.FrostComponents
import com.pitchedapps.frost.ext.GeckoContextId
import com.pitchedapps.frost.ext.idData
import com.pitchedapps.frost.ext.toContextId
import com.pitchedapps.frost.hilt.FrostComponents
import com.pitchedapps.frost.web.state.FrostWebStore
import com.pitchedapps.frost.webview.FrostWebComposer
import dagger.hilt.android.lifecycle.HiltViewModel

View File

@ -38,7 +38,7 @@ object InitAction : FrostWebAction
/** Actions affecting multiple tabs */
sealed interface TabListAction : FrostWebAction {
data class SetHomeTabs(val data: List<FbItem>) : TabListAction
data class SetHomeTabs(val data: List<FbItem>, val selectedTab: Int? = 0) : TabListAction
data class SelectHomeTab(val id: WebTargetId) : TabListAction
}

View File

@ -38,7 +38,11 @@ internal constructor(
is SetHomeTabs -> {
val tabs =
action.data.mapIndexed { i, fbItem -> fbItem.toHomeTabSession(context, i, state.auth) }
state.copy(homeTabs = tabs)
val selectedTab = action.selectedTab?.let { HomeTabSessionState.homeTabId(it) }
state.copy(
homeTabs = tabs,
selectedHomeTab = selectedTab,
)
}
is TabListAction.SelectHomeTab -> state.copy(selectedHomeTab = action.id)
}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.pitchedapps.frost.components.usecases
package com.pitchedapps.frost.web.usecases
import com.pitchedapps.frost.ext.WebTargetId
import com.pitchedapps.frost.facebook.FbItem