update some peertube UI

This commit is contained in:
0xd9a 2023-01-26 08:38:16 +05:30
parent fc34de1da4
commit 58e7346f71
6 changed files with 178 additions and 271 deletions

View File

@ -71,23 +71,10 @@ public class LoginActivity extends BaseBarActivity {
finish();
}
if (getSupportActionBar() != null)
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
SpannableString content_create;
content_create = new SpannableString(getString(R.string.join_peertube));
content_create.setSpan(new UnderlineSpan(), 0, content_create.length(), 0);
content_create.setSpan(new ForegroundColorSpan(Helper.fetchAccentColor(LoginActivity.this)), 0, content_create.length(),
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
binding.createAnAccountPeertube.setText(content_create, TextView.BufferType.SPANNABLE);
binding.createAnAccountPeertube.setOnClickListener(v -> {
Intent mainActivity = new Intent(LoginActivity.this, PeertubeRegisterActivity.class);
startActivity(mainActivity);
});
getSupportActionBar().setTitle(R.string.login);
}
binding.loginInstanceContainer.setVisibility(View.VISIBLE);

View File

@ -14,6 +14,7 @@ package app.fedilab.android.ui.fragment;
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -24,11 +25,10 @@ import androidx.fragment.app.Fragment;
import app.fedilab.android.databinding.FragmentLoginJoinBinding;
import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.peertube.activities.PeertubeRegisterActivity;
public class FragmentLoginJoin extends Fragment {
private FragmentLoginJoinBinding binding;
public View onCreateView(@NonNull LayoutInflater inflater,
@ -41,7 +41,16 @@ public class FragmentLoginJoin extends Fragment {
getParentFragmentManager(), android.R.id.content, new FragmentLoginPickInstanceMastodon(),
null, null, FragmentLoginPickInstanceMastodon.class.getName());
});
binding.joinPeertube.setOnClickListener(v -> {
Intent mainActivity = new Intent(requireActivity(), PeertubeRegisterActivity.class);
startActivity(mainActivity);
});
return root;
}
@Override
public void onDestroyView() {
super.onDestroyView();
binding = null;
}
}

View File

@ -14,147 +14,151 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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"
android:background="?android:windowBackground"
android:orientation="vertical"
android:padding="12dp"
tools:context=".peertube.activities.LoginActivity">
<com.google.android.material.textview.MaterialTextView
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_horizontal"
android:text="@string/invite_join_the_fediverse"
android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium" />
android:orientation="vertical"
android:padding="12dp">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
app:cardElevation="2dp">
<androidx.appcompat.widget.LinearLayoutCompat
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp">
android:layout_marginTop="12dp"
android:gravity="center_horizontal"
android:text="@string/invite_join_the_fediverse"
android:textAppearance="@style/TextAppearance.Material3.HeadlineMedium" />
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
app:cardElevation="2dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="vertical"
android:padding="12dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/logo_mastodon"
android:layout_width="24sp"
android:layout_height="24sp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/logo_mastodon" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/logo_mastodon"
android:layout_width="24sp"
android:layout_height="24sp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/logo_mastodon" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:text="Mastodon"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.textview.MaterialTextView
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:text="Mastodon"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
android:layout_marginTop="12dp"
android:text="@string/about_mastodon"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="- joinmastodon.org"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
tools:ignore="HardcodedText" />
<com.google.android.material.button.MaterialButton
android:id="@+id/join_mastodon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/join_mastodon" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/about_mastodon"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="- joinmastodon.org"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
tools:ignore="HardcodedText" />
<com.google.android.material.button.MaterialButton
android:id="@+id/join_mastodon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/join_mastodon" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
<!--
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
app:cardElevation="2dp">
<androidx.appcompat.widget.LinearLayoutCompat
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="12dp">
android:layout_margin="12dp"
app:cardElevation="2dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="vertical"
android:padding="12dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24sp"
android:layout_height="24sp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/logo_peertub" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/logo_peertube"
android:layout_width="24sp"
android:layout_height="24sp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/peertube_icon" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:text="Peertube"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.textview.MaterialTextView
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1"
android:text="PeerTube"
android:textAppearance="@style/TextAppearance.Material3.Headline5"
android:layout_marginTop="12dp"
android:text="@string/about_peertube"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="- joinpeertube.org"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
tools:ignore="HardcodedText" />
<com.google.android.material.button.MaterialButton
android:id="@+id/join_peertube"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/join_peertube" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/join_peertube_message"
android:textAppearance="@style/TextAppearance.Material3.Caption" />
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="- joinpeertube.org"
android:textAppearance="@style/TextAppearance.Material3.Caption"
tools:ignore="HardcodedText" />
<com.google.android.material.button.MaterialButton
android:id="@+id/join_peertube"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/join_peertube" />
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
-->
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</ScrollView>

View File

@ -14,168 +14,73 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat 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:orientation="vertical">
android:gravity="center"
android:orientation="vertical"
android:padding="24dp">
<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_instance_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:hint="@string/instance">
<ImageView
android:id="@+id/main_logo"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:contentDescription="@string/app_logo"
android:src="@drawable/ic_launcher_foreground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/create_an_account_peertube"
android:layout_width="wrap_content"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_instance"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:drawablePadding="10dp"
android:gravity="center"
android:text="@string/join_peertube"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/main_logo" />
android:enabled="false"
android:importantForAutofill="no"
android:inputType="textWebEmailAddress"
android:singleLine="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.textfield.TextInputLayout>
<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_uid_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:paddingStart="50dp"
android:paddingEnd="50dp">
android:layout_height="wrap_content"
android:layout_marginTop="12dp">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_instance_container"
android:layout_width="0dp"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_uid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
android:hint="@string/username_or_email"
android:importantForAutofill="no"
android:inputType="textEmailAddress"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_instance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="false"
android:hint="@string/title_instance_login"
android:importantForAutofill="no"
android:inputType="textWebEmailAddress"
android:paddingTop="2dp"
android:singleLine="true" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_passwd_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:passwordToggleEnabled="true">
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/instance_picker_title"
android:layout_width="wrap_content"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/instances_picker"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPassword"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<Spinner
android:id="@+id/instance_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/instance_picker_title" />
<com.google.android.material.button.MaterialButton
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/login"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/login_passwd_container" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrierTop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="instance_picker, login_instance_container" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_uid_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrierTop">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_uid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email_address"
android:importantForAutofill="no"
android:inputType="textEmailAddress"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/login_passwd_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/login_uid_container"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/login_passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPassword"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="login_passwd_container,instance_picker" />
<Button
android:id="@+id/login_button"
style="@style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:drawablePadding="10dp"
android:gravity="center"
android:paddingStart="15dp"
android:paddingTop="12dp"
android:paddingEnd="20dp"
android:paddingBottom="12dp"
android:singleLine="true"
android:text="@string/login"
android:textAllCaps="false"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -302,6 +302,7 @@
<string name="title_video_peertube">Title for the video</string>
<string name="join_peertube">Join Peertube</string>
<string name="agreement_check_peertube">I am at least 16 years old and agree to the %1$s of this instance</string>
<string name="username_or_email">Username/Email</string>
<string name="display_nsfw_videos">Display sensitive videos</string>

View File

@ -673,6 +673,7 @@
<string name="join_the_fediverse">Join the fediverse</string>
<string name="invite_join_the_fediverse">Hi! We invite you to join the Fediverse.</string>
<string name="about_mastodon">\"Mastodon isnt a single website like Twitter or Facebook, it\'s a network of thousands of communities operated by different organizations and individuals that provide a seamless social media experience.\"</string>
<string name="about_peertube">\"PeerTube is a tool for sharing online videos developed by Framasoft, a french non-profit.…PeerTube allows platforms to be connected to each other, creating a big network of platforms that are both autonomous and interconnected.\"</string>
<string name="notif_display_mentions">Mentions</string>
<string name="notif_display_favourites">Favourites</string>
<string name="notif_display_reblogs">Reblogs</string>