Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
A
AllApiDemo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steve
AllApiDemo
Commits
0a4677a0
Commit
0a4677a0
authored
Feb 14, 2022
by
steveQiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 LoginActivity ChangeSimActivity
parent
39f8232b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
155 additions
and
7 deletions
+155
-7
misc.xml
.idea/misc.xml
+2
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+19
-3
MainActivity.kt
app/src/main/java/com/example/simboxapi/ui/MainActivity.kt
+11
-0
ChangeSimActivity.kt
...a/com/example/simboxapi/ui/changeSim/ChangeSimActivity.kt
+25
-0
LoginActivity.kt
...main/java/com/example/simboxapi/ui/login/LoginActivity.kt
+26
-0
activity_change_sim.xml
app/src/main/res/layout/activity_change_sim.xml
+19
-0
activity_login.xml
app/src/main/res/layout/activity_login.xml
+19
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+22
-0
activity_query_country_info.xml
app/src/main/res/layout/activity_query_country_info.xml
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+11
-3
No files found.
.idea/misc.xml
View file @
0a4677a0
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
<component
name=
"DesignSurface"
>
<component
name=
"DesignSurface"
>
<option
name=
"filePathToZoomLevelMap"
>
<option
name=
"filePathToZoomLevelMap"
>
<map>
<map>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_change_sim.xml"
value=
"0.3802083333333333"
/>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_login.xml"
value=
"0.3802083333333333"
/>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_main.xml"
value=
"0.25905797101449274"
/>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_main.xml"
value=
"0.25905797101449274"
/>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_query_country_info.xml"
value=
"0.3802083333333333"
/>
<entry
key=
"..\:/Users/natur/Documents/androidWork/simBoxApi/app/src/main/res/layout/activity_query_country_info.xml"
value=
"0.3802083333333333"
/>
</map>
</map>
...
...
app/src/main/AndroidManifest.xml
View file @
0a4677a0
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tool=
"http://schemas.android.com/tools"
package=
"com.example.simboxapi"
>
package=
"com.example.simboxapi"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
...
@@ -11,13 +12,28 @@
...
@@ -11,13 +12,28 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/Theme.SimBoxApi"
>
android:theme=
"@style/Theme.SimBoxApi"
tool:ignore=
"LockedOrientationActivity"
>
<activity
android:name=
".ui.changeSim.ChangeSimActivity"
android:exported=
"false"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.login.LoginActivity"
android:exported=
"false"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
/>
<activity
<activity
android:name=
".ui.queryCountryInfo.QueryCountryInfoActivity"
android:name=
".ui.queryCountryInfo.QueryCountryInfoActivity"
android:exported=
"false"
/>
android:exported=
"false"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
/>
<activity
<activity
android:name=
".ui.MainActivity"
android:name=
".ui.MainActivity"
android:exported=
"true"
>
android:exported=
"true"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/example/simboxapi/ui/MainActivity.kt
View file @
0a4677a0
...
@@ -4,6 +4,8 @@ import android.os.Bundle
...
@@ -4,6 +4,8 @@ import android.os.Bundle
import
android.view.View
import
android.view.View
import
com.example.simboxapi.base.BaseActivity
import
com.example.simboxapi.base.BaseActivity
import
com.example.simboxapi.databinding.ActivityMainBinding
import
com.example.simboxapi.databinding.ActivityMainBinding
import
com.example.simboxapi.ui.changeSim.ChangeSimActivity
import
com.example.simboxapi.ui.login.LoginActivity
import
com.example.simboxapi.ui.queryCountryInfo.QueryCountryInfoActivity
import
com.example.simboxapi.ui.queryCountryInfo.QueryCountryInfoActivity
class
MainActivity
:
BaseActivity
(),
View
.
OnClickListener
{
class
MainActivity
:
BaseActivity
(),
View
.
OnClickListener
{
...
@@ -21,10 +23,18 @@ class MainActivity : BaseActivity(), View.OnClickListener {
...
@@ -21,10 +23,18 @@ class MainActivity : BaseActivity(), View.OnClickListener {
mVB
.
btnMainQueryCountry
->
{
mVB
.
btnMainQueryCountry
->
{
QueryCountryInfoActivity
.
intentToQueryCountryInfo
(
this
)
QueryCountryInfoActivity
.
intentToQueryCountryInfo
(
this
)
}
}
mVB
.
btnMainLogin
->
{
LoginActivity
.
intentToLogin
(
this
)
}
mVB
.
btnMainChangeSim
->
{
ChangeSimActivity
.
intentToChangeSimActivity
(
this
)
}
}
}
}
}
private
fun
initView
()
{
private
fun
initView
()
{
mVB
.
btnMainQueryCountry
.
setOnClickListener
(
this
)
mVB
.
btnMainQueryCountry
.
setOnClickListener
(
this
)
mVB
.
btnMainLogin
.
setOnClickListener
(
this
)
mVB
.
btnMainChangeSim
.
setOnClickListener
(
this
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/example/simboxapi/ui/changeSim/ChangeSimActivity.kt
0 → 100644
View file @
0a4677a0
package
com.example.simboxapi.ui.changeSim
import
android.content.Context
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
com.example.simboxapi.databinding.ActivityChangeSimBinding
class
ChangeSimActivity
:
AppCompatActivity
()
{
companion
object
{
fun
intentToChangeSimActivity
(
context
:
Context
)
{
val
intent
=
Intent
(
context
,
ChangeSimActivity
::
class
.
java
)
context
.
startActivity
(
intent
)
}
}
private
val
mVB
:
ActivityChangeSimBinding
by
lazy
{
ActivityChangeSimBinding
.
inflate
(
layoutInflater
)
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
mVB
.
root
)
}
}
\ No newline at end of file
app/src/main/java/com/example/simboxapi/ui/login/LoginActivity.kt
0 → 100644
View file @
0a4677a0
package
com.example.simboxapi.ui.login
import
android.content.Context
import
android.content.Intent
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
com.example.simboxapi.databinding.ActivityLoginBinding
class
LoginActivity
:
AppCompatActivity
()
{
companion
object
{
fun
intentToLogin
(
context
:
Context
)
{
val
intent
=
Intent
(
context
,
LoginActivity
::
class
.
java
)
context
.
startActivity
(
intent
)
}
}
private
val
mVB
by
lazy
{
ActivityLoginBinding
.
inflate
(
layoutInflater
)
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
mVB
.
root
)
}
}
\ No newline at end of file
app/src/main/res/layout/activity_change_sim.xml
0 → 100644
View file @
0a4677a0
<?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"
tools:context=
".ui.changeSim.ChangeSimActivity"
>
<TextView
android:text=
"change sim"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
0 → 100644
View file @
0a4677a0
<?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"
tools:context=
".ui.login.LoginActivity"
>
<TextView
android:text=
"login"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
0a4677a0
...
@@ -10,9 +10,30 @@
...
@@ -10,9 +10,30 @@
android:id=
"@+id/btnMainQueryCountry"
android:id=
"@+id/btnMainQueryCountry"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"@string/activity_main_query_country"
android:text=
"@string/activity_main_query_country"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<Button
android:id=
"@+id/btnMainLogin"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"@string/activity_main_login"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/btnMainQueryCountry"
/>
<Button
android:id=
"@+id/btnMainChangeSim"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"@string/activity_main_change_sim"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/btnMainLogin"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_query_country_info.xml
View file @
0a4677a0
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_30"
android:layout_marginTop=
"@dimen/dp_30"
android:text=
"@string/
activity_query_country
_post_api"
android:text=
"@string/
share
_post_api"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/values/strings.xml
View file @
0a4677a0
<resources>
<resources>
<string
name=
"app_name"
>
simBoxApi
</string>
<string
name=
"app_name"
>
simBoxApi
</string>
<!--shareApi-->
<string
name=
"share_post_api"
>
Post Api
</string>
<string
name=
"share_get_api"
>
Get Api
</string>
<!--activity_main-->
<!--activity_main-->
<string
name=
"activity_main_query_country"
>
取得国家资讯
</string>
<string
name=
"activity_main_query_country"
>
取得国家资讯
</string>
<string
name=
"activity_main_login"
>
登入
</string>
<string
name=
"activity_main_change_sim"
>
更换sim
</string>
<!--activity_login-->
<!--activity_change_sim-->
<!--activity_query_country-->
<string
name=
"activity_query_country_post_api"
>
Post Api
</string>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment