forked from element-hq/element-android
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
vector/src/main/java/im/vector/app/features/home/PlaceholderActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2023 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.home | ||
|
||
import android.annotation.SuppressLint | ||
import android.graphics.Color | ||
import android.os.Bundle | ||
import androidx.core.view.WindowCompat | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import im.vector.app.R | ||
import im.vector.app.core.platform.VectorBaseActivity | ||
import im.vector.app.databinding.ActivityPlaceholderBinding | ||
@AndroidEntryPoint | ||
class PlaceholderActivity : | ||
VectorBaseActivity<ActivityPlaceholderBinding>(){ | ||
override fun getBinding() = ActivityPlaceholderBinding.inflate(layoutInflater) | ||
@SuppressLint("ResourceAsColor") | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
window.statusBarColor = Color.TRANSPARENT | ||
setContentView(R.layout.activity_placeholder) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
vector/src/main/java/im/vector/app/features/ui/SplitInitializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2023 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.features.ui | ||
|
||
import android.content.Context | ||
import androidx.startup.Initializer | ||
import androidx.window.embedding.SplitController | ||
import im.vector.app.R | ||
class SplitInitializer : Initializer<SplitController> { | ||
|
||
override fun create(context: Context): SplitController { | ||
SplitController.initialize(context, R.xml.split_configuration) | ||
return SplitController.getInstance() | ||
} | ||
|
||
override fun dependencies(): List<Class<out Initializer<*>>> { | ||
return emptyList() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
|
||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/placeholder"> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<resources | ||
xmlns:window="http://schemas.android.com/apk/res-auto"> | ||
|
||
<!-- Define a split for the named activity pair. --> | ||
<SplitPairRule | ||
window:splitRatio="0.4" | ||
window:splitMinWidth="600dp" | ||
window:finishPrimaryWithSecondary="never" | ||
window:finishSecondaryWithPrimary="always"> | ||
<SplitPairFilter | ||
window:primaryActivityName="im.vector.app.features.home.HomeActivity" | ||
window:secondaryActivityName="im.vector.app.features.home.room.detail.RoomDetailActivity"/> | ||
</SplitPairRule> | ||
|
||
|
||
<!-- Automatically launch a placeholder for the list activity. --> | ||
<SplitPlaceholderRule | ||
window:placeholderActivityName="im.vector.app.features.home.PlaceholderActivity" | ||
window:splitRatio="0.4" | ||
window:splitMinWidth="600dp"> | ||
<ActivityFilter | ||
window:activityName="im.vector.app.features.home.HomeActivity"/> | ||
</SplitPlaceholderRule> | ||
|
||
<!-- Define activities that should never enter a split. Note: Takes | ||
precedence over other split rules. --> | ||
<ActivityRule | ||
window:alwaysExpand="true"> | ||
<ActivityFilter window:activityName="im.vector.app.features.media.VectorAttachmentViewerActivity"/> | ||
<ActivityFilter window:activityName="im.vector.app.features.media.BigImageViewerActivity"/> | ||
|
||
</ActivityRule> | ||
|
||
</resources> |