-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable multiple ARE instances in one page
- Loading branch information
Showing
48 changed files
with
507 additions
and
338 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
31 changes: 31 additions & 0 deletions
31
ARE/app/src/main/java/com/chinalwb/are/demo/ARE_MultiInstanceActivity.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,31 @@ | ||
package com.chinalwb.are.demo | ||
|
||
import android.content.Intent | ||
import android.support.v7.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.chinalwb.are.AREditor | ||
import kotlinx.android.synthetic.main.activity_are__multi_instance.* | ||
import kotlinx.android.synthetic.main.activity_main.* | ||
|
||
class ARE_MultiInstanceActivity : AppCompatActivity() { | ||
|
||
var activeARE : AREditor? = null | ||
|
||
private val areFocusChangeListener = AREditor.ARE_FocusChangeListener { arEditor, hasFocus -> if (hasFocus && arEditor != null) activeARE = arEditor } | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_are__multi_instance) | ||
|
||
are_1.setAreFocusChangeListener(areFocusChangeListener) | ||
are_2.setAreFocusChangeListener(areFocusChangeListener) | ||
are_3.setAreFocusChangeListener(areFocusChangeListener) | ||
are_4.setAreFocusChangeListener(areFocusChangeListener) | ||
|
||
activeARE = are_1 | ||
} | ||
|
||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
this.activeARE?.onActivityResult(requestCode, resultCode, data) | ||
} | ||
} |
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
119 changes: 119 additions & 0 deletions
119
ARE/app/src/main/res/layout/activity_are__multi_instance.xml
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,119 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:are="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".ARE_MultiInstanceActivity"> | ||
|
||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="16sp" | ||
android:background="@color/color_100" | ||
android:padding="8dp" | ||
android:text="ARE One" | ||
android:textColor="@android:color/white" | ||
/> | ||
|
||
<com.chinalwb.are.AREditor | ||
android:id="@+id/are_1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
are:expandMode="FULL" | ||
are:hideToolbar="false" | ||
are:toolbarAlignment="BOTTOM" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="300dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="16sp" | ||
android:background="@color/color_300" | ||
android:padding="8dp" | ||
android:text="ARE Two" | ||
android:textColor="@android:color/white" | ||
/> | ||
|
||
<com.chinalwb.are.AREditor | ||
android:id="@+id/are_2" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
are:expandMode="FULL" | ||
are:hideToolbar="false" | ||
are:toolbarAlignment="BOTTOM" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="200dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="16sp" | ||
android:background="@color/color_600" | ||
android:padding="8dp" | ||
android:text="ARE Three" | ||
android:textColor="@android:color/white" | ||
/> | ||
|
||
<com.chinalwb.are.AREditor | ||
android:id="@+id/are_3" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
are:expandMode="FULL" | ||
are:hideToolbar="false" | ||
are:toolbarAlignment="BOTTOM" /> | ||
|
||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="300dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textSize="16sp" | ||
android:background="@color/color_900" | ||
android:padding="8dp" | ||
android:text="ARE Four" | ||
android:textColor="@android:color/white" | ||
/> | ||
|
||
<com.chinalwb.are.AREditor | ||
android:id="@+id/are_4" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
are:expandMode="FULL" | ||
are:hideToolbar="false" | ||
are:toolbarAlignment="BOTTOM" /> | ||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> | ||
|
||
</android.support.v4.widget.NestedScrollView> |
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
Oops, something went wrong.