Ich bin neu in Android-Entwicklung, und ich entwickle eine App, in der sich mit Hilfe von Firebase anmelden (Anmeldung mit Google, Facebook, Twitter, GitHub und anonym). Aber ich weiß nicht, wie man Logik und Architektur durch Login screesn für meine App richtig gestaltet.Wie richtig einen Anmeldebildschirm zu entwerfen?
Nun, ich erstellt auth_activity.xml in denen:
<LinearLayout
android:id="@+id/btn_group_social"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:layout_margin="15dp"
android:layout_above="@+id/mail_pass">
<ImageButton
android:id="@+id/btn_google"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_google_256dp"
android:scaleType="centerInside"
android:background="@null"/>
<ImageButton
android:id="@+id/btn_facebook"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_facebook_256dp"
android:scaleType="centerInside"
android:background="@null"/>
<ImageButton
android:id="@+id/btn_twitter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_twitter_256dp"
android:scaleType="centerInside"
android:background="@null"/>
<ImageButton
android:id="@+id/btn_gitHub"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/ic_git_hub_256dp"
android:scaleType="centerInside"
android:background="@null"/>
</LinearLayout>
<LinearLayout
android:id="@+id/mail_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="50dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="25dp"
android:paddingBottom="15dp"
android:text="or"/>
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress"
android:hint="@string/email"/>
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
android:hint="@string/password"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btn_access"
android:text="@string/access"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/forgot_your_password"
android:textColor="@color/bg_screen1"
android:paddingTop="15dp"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Skip"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="?android:selectableItemBackground"
android:layout_margin="5dp"/>
Auch ich versuchte, eine Aktivität zu erstellen, in dem ich Google in schreiben implementiert, aber ich glaube nicht, dass es wahr ist, zu schaffen, in eine Aktivität alle Arten anmelden (Google, Facebook und so weiter). Ich verstehe nicht ganz, wie man es richtig organisiert.
Wahrscheinlich hast du ein abgeschlossenes Projekt, in dem du dich eingeloggt hast.
Danke.
Android Studio verfügt über Standardaktivität namens Login-Aktivität. Sie können versuchen, es hinzuzufügen und sehen, ob es funktioniert. Es erstellt automatisch die Layout-Datei und einige Logik. –
Ich glaube wirklich nicht, dass jemand Ihnen ein implementiertes Projekt zur Verfügung stellt, wenn Sie neu bei Android sind. Du wirst nicht lernen. Ich würde eher die Funktionalität zuerst vervollständigen und dann dein Design machen, wie es dir gefallen würde, Dinge wie [this] ansehen (https://sourcey.com/beautiful-android-login-and-signup-screens- with-material-design /) und [dies] (http://graphicdesignjunction.com/2014/03/sign-in-login-app-ui-designs/). Aber ein Ratschlag, Sie benötigen ein vollständigeres Wissen über Layouts/Widget-Attribute, um benutzerdefinierte Layouts zu erstellen. Ich würde nicht erwarten, dass ein Out-of-the-Box-Code zu Ihrem Anwendungsfall –
Genau wie @HonorLT erwähnt, gehen Sie einfach zu Ihrem App-Ordner auf dem Projekt, Linksklick, Neu-> Aktivität-> Login-Aktivität –