Skip to content

Commit

Permalink
display lang, space in team login
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 committed Nov 30, 2023
1 parent ef77f15 commit fa25026
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
import java.util.List;

public class LoginActivity extends SyncActivity {
private Button openCommunity, btnFeedback;
private boolean guest = false;
private TextView tvAvailableSpace, previouslyLoggedIn;
private TextView previouslyLoggedIn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public abstract class SyncActivity extends ProcessUserDataActivity implements Sy
View positiveAction;
String processedUrl;
boolean isSync = false, forceSync = false;
Button btnSignIn, becomeMember, btnGuestLogin, btnLang;
TextView customDeviceName, lblVersion;
Button btnSignIn, becomeMember, btnGuestLogin, btnLang, openCommunity, btnFeedback;
TextView customDeviceName, lblVersion, tvAvailableSpace;
SharedPreferences defaultPref;
ImageButton imgBtnSetting;
SwitchCompat switchChildMode;
Expand Down Expand Up @@ -436,9 +436,9 @@ public void declareMoreElements() {
}
return false;
});
if (!prefData.getTEAMMODE1()) {
setUplanguageButton();
}

setUplanguageButton();

if (defaultPref.getBoolean("saveUsernameAndPassword", false)) {
inputName.setText(settings.getString(getString(R.string.login_user), ""));
inputPassword.setText(settings.getString(getString(R.string.login_password), ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.ole.planet.myplanet.model.User
import org.ole.planet.myplanet.ui.community.HomeCommunityDialogFragment
import org.ole.planet.myplanet.ui.feedback.FeedbackFragment
import org.ole.planet.myplanet.ui.userprofile.TeamListAdapter
import org.ole.planet.myplanet.utilities.FileUtils
import org.ole.planet.myplanet.utilities.Utilities

class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
Expand All @@ -40,8 +41,14 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
imgBtnSetting = activityTeamLoginBinding.imgBtnSetting
syncIcon = activityTeamLoginBinding.syncIcon
lblVersion = activityTeamLoginBinding.lblVersion
btnLang = activityTeamLoginBinding.btnLang
tvAvailableSpace = activityTeamLoginBinding.tvAvailableSpace
openCommunity = activityTeamLoginBinding.openCommunity
btnFeedback = activityTeamLoginBinding.btnFeedback

service = Service(this)

tvAvailableSpace.text = FileUtils.getAvailableOverTotalMemoryFormattedString()
changeLogoColor()
declareElements()
declareMoreElements()
Expand All @@ -65,15 +72,15 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
forceSyncTrigger()

if (Utilities.getUrl().isNotEmpty()) {
activityTeamLoginBinding.openCommunity.visibility = View.VISIBLE
activityTeamLoginBinding.openCommunity.setOnClickListener {
openCommunity.visibility = View.VISIBLE
openCommunity.setOnClickListener {
HomeCommunityDialogFragment().show(supportFragmentManager, "")
}
HomeCommunityDialogFragment().show(supportFragmentManager, "")
} else {
activityTeamLoginBinding.openCommunity.visibility = View.GONE
openCommunity.visibility = View.GONE
}
activityTeamLoginBinding.btnFeedback.setOnClickListener {
btnFeedback.setOnClickListener {
FeedbackFragment().show(supportFragmentManager, "")
}

Expand Down Expand Up @@ -130,7 +137,7 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
.error(R.drawable.profile)
.into(activityTeamLoginBinding.userProfile)

activityTeamLoginBinding.inputName.setText(user.name)
inputName.setText(user.name)
} else {
if (user.source == "guest"){
val model = mRealm.copyFromRealm(RealmUserModel.createGuestUser(user.name, mRealm, settings))
Expand Down
42 changes: 41 additions & 1 deletion app/src/main/res/layout/activity_team_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,54 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<Button
android:id="@+id/btn_lang"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/language"
android:entries="@array/language"
android:padding="@dimen/padding_normal"
android:text="@string/language"
android:textColor="@android:color/white"
android:theme="@style/PrimaryFlatButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lblVersion" />

<LinearLayout
android:id="@+id/ltAvailablaSpace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_lang">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/padding_small"
app:srcCompat="@drawable/baseline_storage_24" />

<TextView
android:id="@+id/tv_available_space"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="@color/md_white_1000"
tools:text="@string/available_space_colon" />
</LinearLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="@dimen/_10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lblVersion" />
app:layout_constraintTop_toBottomOf="@+id/ltAvailablaSpace" />

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

Expand Down

0 comments on commit fa25026

Please sign in to comment.