Commit 58e7346f authored by 0xd9a's avatar 0xd9a
Browse files

update some peertube UI

parent fc34de1d
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -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);

+12 −3
Original line number Diff line number Diff line
@@ -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;
    }
}
 No newline at end of file
+107 −103
Original line number Diff line number Diff line
@@ -14,17 +14,20 @@
    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">

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="12dp">

        <com.google.android.material.textview.MaterialTextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
@@ -95,7 +98,6 @@

        </com.google.android.material.card.MaterialCardView>

    <!--
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
@@ -115,19 +117,20 @@
                    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/logo_peertub" />
                        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.Headline5"
                        android:text="Peertube"
                        android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
                        tools:ignore="HardcodedText" />

                </androidx.appcompat.widget.LinearLayoutCompat>
@@ -136,14 +139,14 @@
                    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" />
                    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.Caption"
                    android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                    tools:ignore="HardcodedText" />

                <com.google.android.material.button.MaterialButton
@@ -156,5 +159,6 @@
            </androidx.appcompat.widget.LinearLayoutCompat>

        </com.google.android.material.card.MaterialCardView>
    -->

    </androidx.appcompat.widget.LinearLayoutCompat>
</ScrollView>
 No newline at end of file
+56 −151
Original line number Diff line number Diff line
@@ -14,115 +14,43 @@
    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">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <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"
            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" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="20dp"
        android:paddingStart="50dp"
        android:paddingEnd="50dp">
    android:orientation="vertical"
    android:padding="24dp">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/login_instance_container"
            android:layout_width="0dp"
        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/instance">

        <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: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>

        <TextView
            android:id="@+id/instance_picker_title"
            android:layout_width="wrap_content"
            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" />

        <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" />

        <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_width="match_parent"
        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">
        android:layout_marginTop="12dp">

        <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:hint="@string/username_or_email"
            android:importantForAutofill="no"
            android:inputType="textEmailAddress"
            android:singleLine="true" />
@@ -130,12 +58,9 @@

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/login_passwd_container"
            android:layout_width="0dp"
        android:layout_width="match_parent"
        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"
        android:layout_marginTop="12dp"
        app:passwordToggleEnabled="true">

        <com.google.android.material.textfield.TextInputEditText
@@ -148,34 +73,14 @@
            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
    <com.google.android.material.button.MaterialButton
        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:layout_marginTop="24dp"
        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" />
        app:layout_constraintTop_toBottomOf="@id/login_passwd_container" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
 No newline at end of file
</androidx.appcompat.widget.LinearLayoutCompat>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -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>
Loading