-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from Pixel-Crusader/2.4
Added error activities
- Loading branch information
Showing
10 changed files
with
169 additions
and
31 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/itmo/wineup/features/errors/Error404Activity.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.itmo.wineup.features.errors | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.bumptech.glide.Glide | ||
import com.itmo.wineup.MainActivity | ||
import com.itmo.wineup.R | ||
import kotlinx.android.synthetic.main.error_404.* | ||
|
||
class Error404Activity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.error_404) | ||
Glide.with(error_404_background) | ||
.load(R.drawable.error_404_background) | ||
.into(error_404_background) | ||
withoutAuthButton.setOnClickListener { | ||
val loginIntent = Intent(applicationContext, MainActivity::class.java) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
startActivity(loginIntent) | ||
} | ||
button_back.setOnClickListener { | ||
finish() | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/itmo/wineup/features/errors/Error503Activity.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.itmo.wineup.features.errors | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.bumptech.glide.Glide | ||
import com.itmo.wineup.MainActivity | ||
import com.itmo.wineup.R | ||
import kotlinx.android.synthetic.main.error_503.* | ||
|
||
class Error503Activity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.error_503) | ||
Glide.with(error_503_background) | ||
.load(R.drawable.error_503_background) | ||
.into(error_503_background) | ||
withoutAuthButton.setOnClickListener { | ||
val loginIntent = Intent(applicationContext, MainActivity::class.java) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
startActivity(loginIntent) | ||
} | ||
button_back.setOnClickListener { | ||
finish() | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/itmo/wineup/features/errors/ErrorPageNotFoundActivity.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.itmo.wineup.features.errors | ||
|
||
import android.content.Intent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.bumptech.glide.Glide | ||
import com.itmo.wineup.MainActivity | ||
import com.itmo.wineup.R | ||
import kotlinx.android.synthetic.main.page_not_found.* | ||
|
||
class ErrorPageNotFoundActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.page_not_found) | ||
Glide.with(error_background) | ||
.load(R.drawable.picture4) | ||
.into(error_background) | ||
withoutAuthButton.setOnClickListener { | ||
val loginIntent = Intent(applicationContext, MainActivity::class.java) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP) | ||
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
startActivity(loginIntent) | ||
} | ||
button.setOnClickListener { | ||
finish() | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,14 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<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=".features.main.presentation.MainFragment"> | ||
|
||
<!-- TODO: Update blank fragment layout --> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="Главная" /> | ||
<ImageView | ||
android:id="@+id/logo" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:src="@drawable/wineup_logo" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</FrameLayout> | ||
<Button | ||
android:id="@+id/button1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="404" | ||
app:layout_constraintEnd_toStartOf="@+id/button2" | ||
app:layout_constraintHorizontal_bias="0.5" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/logo" /> | ||
|
||
<Button | ||
android:id="@+id/button2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="503" | ||
app:layout_constraintEnd_toStartOf="@+id/button3" | ||
app:layout_constraintHorizontal_bias="0.5" | ||
app:layout_constraintStart_toEndOf="@+id/button1" | ||
app:layout_constraintTop_toBottomOf="@id/logo" /> | ||
|
||
<Button | ||
android:id="@+id/button3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="PNF" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.5" | ||
app:layout_constraintStart_toEndOf="@+id/button2" | ||
app:layout_constraintTop_toBottomOf="@id/logo" /> | ||
|
||
</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