-
Notifications
You must be signed in to change notification settings - Fork 0
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
9 changed files
with
198 additions
and
11 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
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/deliner/mosfauna/activity/BirdInfoActivity.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,28 @@ | ||
package com.deliner.mosfauna.activity | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import android.widget.Button | ||
import android.widget.EditText | ||
import com.deliner.mosfauna.R | ||
import com.deliner.mosfauna.utils.LoginManager | ||
|
||
class BirdInfoActivity : UserActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_login) | ||
|
||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
if (item.itemId == android.R.id.home) { | ||
onBackPressed() | ||
return true | ||
} | ||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
app/src/main/java/com/deliner/mosfauna/dialog/PlaceMarkerDialog.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,55 @@ | ||
package com.deliner.mosfauna.dialog | ||
|
||
import android.content.DialogInterface | ||
import android.os.Bundle | ||
import android.os.Message | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.Button | ||
import android.widget.EditText | ||
import android.widget.TextView | ||
import com.deliner.mosfauna.R | ||
import com.deliner.mosfauna.system.CoreConst | ||
|
||
|
||
class PlaceMarkerDialog private constructor() : CommonDialogFragment() { | ||
|
||
private lateinit var name: String | ||
private var success = false | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
val view = inflater.inflate(R.layout.dialog_place_marker, container, false) | ||
view.findViewById<TextView>(R.id.dialog_place_marker_title).text = | ||
"Указать на ${name.toLowerCase()} на карте?" | ||
|
||
view.findViewById<Button>(R.id.dialog_request_code_send).setOnClickListener { | ||
success = true | ||
Message.obtain(callback, CoreConst.ON_SEND_MARKER, name).sendToTarget() | ||
dismiss() | ||
} | ||
view.findViewById<Button>(R.id.dialog_request_code_cancel).setOnClickListener { | ||
dismiss() | ||
} | ||
return view | ||
} | ||
|
||
override fun onDismiss(dialog: DialogInterface) { | ||
super.onDismiss(dialog) | ||
if (!success) { | ||
Message.obtain(callback, CoreConst.ON_CANCEL_MARKER, name).sendToTarget() | ||
} | ||
} | ||
|
||
companion object { | ||
fun getInstance(name: String): PlaceMarkerDialog { | ||
val dialog = PlaceMarkerDialog() | ||
dialog.name = name | ||
return dialog | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fitsSystemWindows="true"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<include | ||
android:id="@+id/toolbar" | ||
layout="@layout/toolbar" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</androidx.drawerlayout.widget.DrawerLayout> |
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,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="16dp"> | ||
|
||
<TextView | ||
android:id="@+id/dialog_place_marker_title" | ||
style="@style/TextAppearance.AppCompat.Title" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginBottom="12dp"/> | ||
|
||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<Button | ||
android:id="@+id/dialog_request_code_cancel" | ||
style="?attr/buttonBarButtonStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_toStartOf="@+id/dialog_request_code_send" | ||
android:text="Отмена"/> | ||
|
||
<Button | ||
android:id="@+id/dialog_request_code_send" | ||
style="?attr/buttonBarButtonStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentEnd="true" | ||
android:text="Да"/> | ||
</RelativeLayout> | ||
</LinearLayout> |