new file layout and bottomsheet link

This commit is contained in:
M M Arif 2019-09-17 11:17:05 +05:00
parent c3da1900a0
commit c38d249571
8 changed files with 262 additions and 19 deletions

View File

@ -11,8 +11,11 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".activities.RepoWatchersActivity" android:name=".activities.NewFileActivity"
android:theme="@style/AppTheme.NoActionBar"></activity> android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name=".activities.RepoWatchersActivity"
android:theme="@style/AppTheme.NoActionBar" />
<activity <activity
android:name=".activities.RepoStargazersActivity" android:name=".activities.RepoStargazersActivity"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
@ -61,8 +64,8 @@
<activity android:name=".activities.NewOrganizationActivity" /> <activity android:name=".activities.NewOrganizationActivity" />
<activity android:name=".activities.OpenRepoInBrowserActivity" /> <activity android:name=".activities.OpenRepoInBrowserActivity" />
</application> </application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest> </manifest>

View File

@ -0,0 +1,22 @@
package org.mian.gitnex.activities;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import org.mian.gitnex.R;
/**
* Author M M Arif
*/
public class NewFileActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_file);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
}

View File

@ -108,7 +108,6 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS
} }
} }
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
@ -165,6 +164,9 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS
Intent i = new Intent(Intent.ACTION_VIEW, url); Intent i = new Intent(Intent.ACTION_VIEW, url);
startActivity(i); startActivity(i);
break; break;
case "newFile":
startActivity(new Intent(RepoDetailActivity.this, NewFileActivity.class));
break;
} }
} }

View File

@ -30,6 +30,7 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
TextView addCollaborator = v.findViewById(R.id.addCollaborator); TextView addCollaborator = v.findViewById(R.id.addCollaborator);
TextView createRelease = v.findViewById(R.id.createRelease); TextView createRelease = v.findViewById(R.id.createRelease);
TextView openWebRepo = v.findViewById(R.id.openWebRepo); TextView openWebRepo = v.findViewById(R.id.openWebRepo);
TextView newFile = v.findViewById(R.id.newFile);
createLabel.setOnClickListener(new View.OnClickListener() { createLabel.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -79,6 +80,14 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
} }
}); });
newFile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bmListener.onButtonClicked("newFile");
dismiss();
}
});
return v; return v;
} }

View File

@ -61,7 +61,6 @@
android:padding="10dp" android:padding="10dp"
android:textSize="14sp" android:textSize="14sp"
tools:ignore="Autofill" tools:ignore="Autofill"
android:labelFor="@+id/instance_url"
android:background="@drawable/shape_inputs" android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_link_24dp" android:drawableStart="@drawable/ic_link_24dp"
android:drawablePadding="10dp" android:drawablePadding="10dp"
@ -79,7 +78,6 @@
android:padding="10dp" android:padding="10dp"
android:textSize="14sp" android:textSize="14sp"
tools:ignore="Autofill" tools:ignore="Autofill"
android:labelFor="@+id/login_uid"
android:background="@drawable/shape_inputs" android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_person_24dp" android:drawableStart="@drawable/ic_person_24dp"
android:drawablePadding="10dp" android:drawablePadding="10dp"
@ -97,7 +95,6 @@
android:padding="10dp" android:padding="10dp"
android:textSize="14sp" android:textSize="14sp"
tools:ignore="Autofill" tools:ignore="Autofill"
android:labelFor="@+id/login_passwd"
android:background="@drawable/shape_inputs" android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_lock_24dp" android:drawableStart="@drawable/ic_lock_24dp"
android:drawablePadding="10dp" android:drawablePadding="10dp"
@ -115,7 +112,6 @@
android:padding="10dp" android:padding="10dp"
android:textSize="14sp" android:textSize="14sp"
tools:ignore="Autofill" tools:ignore="Autofill"
android:labelFor="@+id/otpCode"
android:background="@drawable/shape_inputs" android:background="@drawable/shape_inputs"
android:drawableStart="@drawable/ic_otp" android:drawableStart="@drawable/ic_otp"
android:drawablePadding="10dp" android:drawablePadding="10dp"

View File

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/colorPrimary">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:contentDescription="@string/close"
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pageTitleNewFile"
android:textColor="@color/white"
android:maxLines="1"
android:textSize="20sp" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/backgroundColor">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:paddingBottom="30dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileNameTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp" />
<EditText
android:id="@+id/newFileName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileName"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileNameHintMessage"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileContentTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:background="@drawable/shape_inputs"
android:maxLines="16"
android:minLines="14"
tools:ignore="Autofill"
android:labelFor="@+id/newFileContent"
android:scrollbars="vertical"
android:gravity="top|start"
android:textSize="14sp"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|textMultiLine"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileBranchTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileBranchName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileBranchName"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/newFileMessageTintCopy"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:layout_marginTop="10dp" />
<EditText
android:id="@+id/newFileCommitMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dp"
android:textSize="14sp"
tools:ignore="Autofill"
android:labelFor="@+id/newFileCommitMessage"
android:background="@drawable/shape_inputs"
android:textColor="@color/colorWhite"
android:textColorHint="@color/colorWhite"
android:inputType="textCapSentences|text"
android:textColorHighlight="@color/colorWhite"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/characters255Limit"
android:textColor="@color/hintColor"
android:textSize="12sp"
android:paddingStart="10dp"
android:paddingEnd="5dp"
android:gravity="end" />
<Button
android:id="@+id/newFileCreate"
android:gravity="center"
android:layout_gravity="end"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="@string/newFileButtonCopy"
android:background="@drawable/shape_buttons"
android:textColor="@color/btnTextColor" />
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@ -7,6 +7,18 @@
android:background="@color/backgroundColor" android:background="@color/backgroundColor"
android:paddingTop="8dp"> android:paddingTop="8dp">
<TextView
android:id="@+id/newFile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/pageTitleNewFile"
android:drawableStart="@drawable/ic_file"
android:drawablePadding="24dp"
android:textColor="@color/white"
android:textSize="16sp"
android:padding="16dp" />
<TextView <TextView
android:id="@+id/createNewIssue" android:id="@+id/createNewIssue"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -40,20 +40,21 @@
<string name="pageTitleMyRepos">My Repositories</string> <string name="pageTitleMyRepos">My Repositories</string>
<string name="pageTitleRepositories">Repositories</string> <string name="pageTitleRepositories">Repositories</string>
<string name="pageTitleProfile">Profile</string> <string name="pageTitleProfile">Profile</string>
<string name="pageTitleNewRepo">Create Repository</string> <string name="pageTitleNewRepo">New Repository</string>
<string name="pageTitleOrganizations">Organizations</string> <string name="pageTitleOrganizations">Organizations</string>
<string name="pageTitleIssues">Issues</string> <string name="pageTitleIssues">Issues</string>
<string name="pageTitleSettings">Settings</string> <string name="pageTitleSettings">Settings</string>
<string name="pageTitleCreateOrganization">Create Organization</string> <string name="pageTitleCreateOrganization">New Organization</string>
<string name="pageTitleCreateMilestone">Create Milestone</string> <string name="pageTitleCreateMilestone">New Milestone</string>
<string name="pageTitleCreateNewIssue">Create Issue</string> <string name="pageTitleCreateNewIssue">New Issue</string>
<string name="pageTitleCreateLabel">Create Label</string> <string name="pageTitleCreateLabel">New Label</string>
<string name="pageTitleCredits">Credits</string> <string name="pageTitleCredits">Credits</string>
<string name="pageTitleLabelUpdate">Update Label</string> <string name="pageTitleLabelUpdate">Update Label</string>
<string name="pageTitleSponsors">Sponsors</string> <string name="pageTitleSponsors">Sponsors</string>
<string name="pageTitleStarredRepos">Starred Repositories</string> <string name="pageTitleStarredRepos">Starred Repositories</string>
<string name="pageTitleCreateTeam">Create Team</string> <string name="pageTitleCreateTeam">New Team</string>
<string name="pageTitleAddEmail">Add Email Address</string> <string name="pageTitleAddEmail">Add Email Address</string>
<string name="pageTitleNewFile">New File</string>
<!-- page titles --> <!-- page titles -->
<string name="appVersion">Version\u0020:\u0020</string> <string name="appVersion">Version\u0020:\u0020</string>
@ -260,7 +261,7 @@
<string name="noMoreData">No more data available.</string> <string name="noMoreData">No more data available.</string>
<string name="createLabel">Create Label</string> <string name="createLabel">New Label</string>
<string name="menuTitleText">Repo Menu</string> <string name="menuTitleText">Repo Menu</string>
<string name="labelName">Label Name</string> <string name="labelName">Label Name</string>
<string name="labelColor">Label Color</string> <string name="labelColor">Label Color</string>
@ -299,7 +300,7 @@
<string name="orgTabRepos">Repositories</string> <string name="orgTabRepos">Repositories</string>
<string name="orgTabTeams">Teams</string> <string name="orgTabTeams">Teams</string>
<string name="orgTabMembers">Members</string> <string name="orgTabMembers">Members</string>
<string name="orgCreateTeam">Create Team</string> <string name="orgCreateTeam">New Team</string>
<string name="noDataTeams">No teams found</string> <string name="noDataTeams">No teams found</string>
<string name="teamTitle">Team name</string> <string name="teamTitle">Team name</string>
<string name="teamDescription">Team desc</string> <string name="teamDescription">Team desc</string>
@ -387,7 +388,7 @@
<string name="repoMetaData">Repository Meta</string> <string name="repoMetaData">Repository Meta</string>
<!-- admin --> <!-- admin -->
<string name="adminCreateNewUser">Create New User</string> <string name="adminCreateNewUser">Add New User</string>
<string name="adminUsers">Users</string> <string name="adminUsers">Users</string>
<string name="userRoleAdmin">Admin</string> <string name="userRoleAdmin">Admin</string>
<!-- admin --> <!-- admin -->
@ -400,7 +401,7 @@
<string name="userInvalidFullName">Invalid Full Name</string> <string name="userInvalidFullName">Invalid Full Name</string>
<string name="userInvalidUserName">Invalid Username</string> <string name="userInvalidUserName">Invalid Username</string>
<string name="userInvalidEmail">Invalid Email</string> <string name="userInvalidEmail">Invalid Email</string>
<string name="userCreatedText">New user created successfully</string> <string name="userCreatedText">New user added successfully</string>
<string name="userExistsError">User already exists</string> <string name="userExistsError">User already exists</string>
<!-- create user --> <!-- create user -->
@ -416,7 +417,7 @@
<!-- edit issue --> <!-- edit issue -->
<!-- release --> <!-- release -->
<string name="createRelease">Create Release</string> <string name="createRelease">New Release</string>
<string name="releaseTagNameText">Tag Name</string> <string name="releaseTagNameText">Tag Name</string>
<string name="releaseTitleText">Title</string> <string name="releaseTitleText">Title</string>
<string name="releaseContentText">Content</string> <string name="releaseContentText">Content</string>
@ -446,6 +447,14 @@
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string> <string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string> <string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
<!-- new file -->
<string name="newFileNameTintCopy">File Name</string>
<string name="newFileBranchTintCopy">Branch Name</string>
<string name="newFileContentTintCopy">File Content</string>
<string name="newFileButtonCopy">Create New File</string>
<string name="newFileNameHintMessage">with folder: app/test.md</string>
<string name="newFileMessageTintCopy">Commit Message</string>
<!-- generic copy --> <!-- generic copy -->
<string name="okButton">OK</string> <string name="okButton">OK</string>
<string name="doneButton">Done</string> <string name="doneButton">Done</string>
@ -468,6 +477,7 @@
<string name="descriptionText">Description</string> <string name="descriptionText">Description</string>
<string name="websiteText">Website</string> <string name="websiteText">Website</string>
<string name="locationText">Location</string> <string name="locationText">Location</string>
<string name="characters255Limit">Max 255 characters</string>
<!-- generic copy --> <!-- generic copy -->
</resources> </resources>