-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple account UI #52
Open
anuragshukla06
wants to merge
3
commits into
client-dev
Choose a base branch
from
multiple-account-ui
base: client-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
.../main/java/com/microsoft/research/karya/data/exceptions/AccessCodeAlreadyUsedException.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,3 @@ | ||
package com.microsoft.research.karya.data.exceptions | ||
|
||
class AccessCodeAlreadyUsedException(message: String) : Exception(message) |
3 changes: 0 additions & 3 deletions
3
...main/java/com/microsoft/research/karya/data/exceptions/PhoneNumberAlreadyUsedException.kt
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...app/src/main/java/com/microsoft/research/karya/data/exceptions/SessionExpiredException.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,3 @@ | ||
package com.microsoft.research.karya.data.exceptions | ||
|
||
class SessionExpiredException(message: String) : Exception(message) |
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
23 changes: 22 additions & 1 deletion
23
client/app/src/main/java/com/microsoft/research/karya/utils/Result.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 |
---|---|---|
@@ -1,7 +1,28 @@ | ||
package com.microsoft.research.karya.utils | ||
|
||
import com.microsoft.research.karya.R | ||
import com.microsoft.research.karya.data.exceptions.AccessCodeAlreadyUsedException | ||
import com.microsoft.research.karya.data.exceptions.IncorrectAccessCodeException | ||
import com.microsoft.research.karya.data.exceptions.IncorrectOtpException | ||
import com.microsoft.research.karya.data.exceptions.UnknownException | ||
import java.net.SocketTimeoutException | ||
import java.net.UnknownHostException | ||
|
||
sealed class Result { | ||
class Success<T>(val value: T) : Result() | ||
class Error(val exception: Throwable) : Result() | ||
class Error(val exception: Throwable) : Result() { | ||
val errorMessageId = | ||
when (exception) { | ||
is UnknownHostException -> R.string.s_no_internet_or_server_down | ||
is SocketTimeoutException -> R.string.s_no_internet_or_server_down | ||
// Socket Timeout may also happen due to bad internet connection, maybe indicate in the | ||
// string? | ||
is AccessCodeAlreadyUsedException -> R.string.s_phone_number_already_used | ||
is IncorrectAccessCodeException -> R.string.s_invalid_creation_code | ||
is IncorrectOtpException -> R.string.s_invalid_otp | ||
is UnknownException -> R.string.s_unknown_error | ||
else -> R.string.s_unknown_error | ||
} | ||
} | ||
object Loading : Result() | ||
} |
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,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Please choose your account" | ||
android:gravity="center" | ||
android:textColor="#000000" | ||
android:textSize="@dimen/_18ssp" | ||
android:layout_marginBottom="@dimen/_18sdp" | ||
/> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:itemCount="3" | ||
tools:listitem="@layout/item_user_account" /> | ||
|
||
</LinearLayout> |
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.cardview.widget.CardView 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" | ||
app:cardCornerRadius="@dimen/_10sdp" | ||
android:elevation="@dimen/_3sdp"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
> | ||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
tools:src="@tools:sample/avatars" | ||
android:padding="8dp" /> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:layout_gravity="center"> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
tools:text="Anurag Shukla" | ||
android:textSize="@dimen/_28ssp" | ||
android:textColor="@color/colorBlack"/> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
tools:text="9399151865" | ||
android:textSize="@dimen/_20ssp"/> | ||
</LinearLayout> | ||
</LinearLayout> | ||
|
||
</androidx.cardview.widget.CardView> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this from both of your PRs?