Redesign releases screen (#526)

Add download assets

implement release layout in adapter

update the layout

Fixing gravity.

Adding layouts for new release items.

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
This commit is contained in:
opyale 2020-06-11 01:45:11 +02:00 committed by 6543
parent 008e446b93
commit 5005fcc5b5
10 changed files with 489 additions and 161 deletions

View File

@ -10,19 +10,25 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.amulyakhare.textdrawable.TextDrawable; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.vdurmont.emoji.EmojiParser; import com.vdurmont.emoji.EmojiParser;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.helpers.ClickListener;
import org.mian.gitnex.helpers.RoundedTransformation;
import org.mian.gitnex.helpers.TimeHelper;
import org.mian.gitnex.models.Releases; import org.mian.gitnex.models.Releases;
import org.mian.gitnex.util.TinyDB; import org.mian.gitnex.util.TinyDB;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import io.noties.markwon.AbstractMarkwonPlugin; import io.noties.markwon.AbstractMarkwonPlugin;
import io.noties.markwon.Markwon; import io.noties.markwon.Markwon;
import io.noties.markwon.core.CorePlugin; import io.noties.markwon.core.CorePlugin;
@ -31,7 +37,6 @@ import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.ext.tables.TablePlugin; import io.noties.markwon.ext.tables.TablePlugin;
import io.noties.markwon.ext.tasklist.TaskListPlugin; import io.noties.markwon.ext.tasklist.TaskListPlugin;
import io.noties.markwon.html.HtmlPlugin; import io.noties.markwon.html.HtmlPlugin;
import io.noties.markwon.image.AsyncDrawable;
import io.noties.markwon.image.DefaultMediaDecoder; import io.noties.markwon.image.DefaultMediaDecoder;
import io.noties.markwon.image.ImageItem; import io.noties.markwon.image.ImageItem;
import io.noties.markwon.image.ImagesPlugin; import io.noties.markwon.image.ImagesPlugin;
@ -49,25 +54,44 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
private List<Releases> releasesList; private List<Releases> releasesList;
private Context mCtx; private Context mCtx;
static class ReleasesViewHolder extends RecyclerView.ViewHolder { static class ReleasesViewHolder extends RecyclerView.ViewHolder {
private ImageView releaseType; private TextView releaseType;
private TextView releaseTitle; private TextView releaseName;
private TextView releaseDescription; private ImageView authorAvatar;
private TextView releaseDownload; private TextView authorName;
private TextView releaseZipDownload;
private TextView releaseTarDownload;
private TextView releaseTag; private TextView releaseTag;
private TextView releaseCommitSha;
private TextView releaseDate;
private TextView releaseBodyContent;
private LinearLayout downloadFrame;
private RelativeLayout downloads;
private TextView releaseZipDownload;
private TextView releaseTarDownload;
private ImageView downloadDropdownIcon;
private RecyclerView downloadList;
private ReleasesViewHolder(View itemView) { private ReleasesViewHolder(View itemView) {
super(itemView); super(itemView);
releaseType = itemView.findViewById(R.id.releaseType); releaseType = itemView.findViewById(R.id.releaseType);
releaseTitle = itemView.findViewById(R.id.releaseTitle); releaseName = itemView.findViewById(R.id.releaseName);
releaseDescription = itemView.findViewById(R.id.releaseDescription); authorAvatar = itemView.findViewById(R.id.authorAvatar);
releaseZipDownload = itemView.findViewById(R.id.releaseZipDownload); authorName = itemView.findViewById(R.id.authorName);
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload); releaseTag = itemView.findViewById(R.id.releaseTag);
releaseTag = itemView.findViewById(R.id.releaseTag); releaseCommitSha = itemView.findViewById(R.id.releaseCommitSha);
releaseDate = itemView.findViewById(R.id.releaseDate);
releaseBodyContent = itemView.findViewById(R.id.releaseBodyContent);
downloadFrame = itemView.findViewById(R.id.downloadFrame);
downloads = itemView.findViewById(R.id.downloads);
releaseZipDownload = itemView.findViewById(R.id.releaseZipDownload);
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon);
downloadList = itemView.findViewById(R.id.downloadList);
downloadList.setHasFixedSize(true);
downloadList.setLayoutManager(new LinearLayoutManager(itemView.getContext()));
} }
} }
@ -88,83 +112,74 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
public void onBindViewHolder(@NonNull ReleasesAdapter.ReleasesViewHolder holder, int position) { public void onBindViewHolder(@NonNull ReleasesAdapter.ReleasesViewHolder holder, int position) {
final TinyDB tinyDb = new TinyDB(mCtx); final TinyDB tinyDb = new TinyDB(mCtx);
final String locale = tinyDb.getString("locale");
final String timeFormat = tinyDb.getString("dateFormat");
Releases currentItem = releasesList.get(position); Releases currentItem = releasesList.get(position);
holder.releaseTitle.setText(currentItem.getName()); holder.releaseName.setText(currentItem.getName());
if(!currentItem.getTag_name().equals("")) { if(currentItem.isPrerelease()) {
holder.releaseTag.setText(mCtx.getResources().getString(R.string.releaseTag, currentItem.getTag_name())); holder.releaseType.setBackgroundResource(R.drawable.shape_pre_release);
} holder.releaseType.setText(R.string.releaseTypePre);
else { }
holder.releaseTag.setVisibility(View.GONE); else if(currentItem.isDraft()) {
} holder.releaseType.setVisibility(View.GONE);
}
else {
holder.releaseType.setBackgroundResource(R.drawable.shape_stable_release);
holder.releaseType.setText(R.string.releaseTypeStable);
}
if(currentItem.isPrerelease()) { if(currentItem.getAuthor().getAvatar_url() != null) {
TextDrawable drawable = TextDrawable.builder() PicassoService.getInstance(mCtx).get().load(currentItem.getAuthor().getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.authorAvatar);
.beginConfig() }
//.useFont(Typeface.DEFAULT)
.textColor(mCtx.getResources().getColor(R.color.white)) holder.authorName.setText(mCtx.getResources().getString(R.string.releasePublishedBy, currentItem.getAuthor().getUsername()));
.fontSize(34)
.width(260) if(currentItem.getTag_name() != null) {
.height(60) holder.releaseTag.setText(currentItem.getTag_name());
.endConfig() }
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypePre), mCtx.getResources().getColor(R.color.releasePre), 8);
holder.releaseType.setImageDrawable(drawable); if(currentItem.getPublished_at() != null) {
} holder.releaseDate.setText(TimeHelper.formatTime(currentItem.getPublished_at(), new Locale(locale), timeFormat, mCtx));
else { }
TextDrawable drawable = TextDrawable.builder()
.beginConfig() if(timeFormat.equals("pretty")) {
//.useFont(Typeface.DEFAULT) holder.releaseDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getPublished_at()), mCtx));
.textColor(mCtx.getResources().getColor(R.color.white)) }
.fontSize(34)
.width(260)
.height(60)
.endConfig()
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypeStable), mCtx.getResources().getColor(R.color.releaseStable), 8);
holder.releaseType.setImageDrawable(drawable);
}
final Markwon markwon = Markwon.builder(Objects.requireNonNull(mCtx)) final Markwon markwon = Markwon.builder(Objects.requireNonNull(mCtx))
.usePlugin(CorePlugin.create()) .usePlugin(CorePlugin.create())
.usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() { .usePlugin(ImagesPlugin.create(plugin -> {
@Override plugin.addSchemeHandler(new SchemeHandler() {
public void configureImages(@NonNull ImagesPlugin plugin) { @NonNull
plugin.addSchemeHandler(new SchemeHandler() { @Override
@NonNull public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
@Override
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
final int resourceId = mCtx.getResources().getIdentifier( final int resourceId = mCtx.getResources().getIdentifier(
raw.substring("drawable://".length()), raw.substring("drawable://".length()),
"drawable", "drawable",
mCtx.getPackageName()); mCtx.getPackageName());
final Drawable drawable = mCtx.getDrawable(resourceId); final Drawable drawable = mCtx.getDrawable(resourceId);
assert drawable != null; assert drawable != null;
return ImageItem.withResult(drawable); return ImageItem.withResult(drawable);
} }
@NonNull @NonNull
@Override @Override
public Collection<String> supportedSchemes() { public Collection<String> supportedSchemes() {
return Collections.singleton("drawable"); return Collections.singleton("drawable");
} }
}); });
plugin.placeholderProvider(new ImagesPlugin.PlaceholderProvider() { plugin.placeholderProvider(drawable -> null);
@Nullable plugin.addMediaDecoder(GifMediaDecoder.create(false));
@Override plugin.addMediaDecoder(SvgMediaDecoder.create(mCtx.getResources()));
public Drawable providePlaceholder(@NonNull AsyncDrawable drawable) { plugin.addMediaDecoder(SvgMediaDecoder.create());
return null; plugin.defaultMediaDecoder(DefaultMediaDecoder.create(mCtx.getResources()));
} plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
});
plugin.addMediaDecoder(GifMediaDecoder.create(false));
plugin.addMediaDecoder(SvgMediaDecoder.create(mCtx.getResources()));
plugin.addMediaDecoder(SvgMediaDecoder.create());
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(mCtx.getResources()));
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
}
})) }))
.usePlugin(new AbstractMarkwonPlugin() { .usePlugin(new AbstractMarkwonPlugin() {
@Override @Override
@ -185,12 +200,29 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(currentItem.getBody())); Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(currentItem.getBody()));
if(!currentItem.getBody().equals("")) { if(!currentItem.getBody().equals("")) {
markwon.setParsedMarkdown(holder.releaseDescription, bodyWithMD); markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD);
} }
else { else {
holder.releaseDescription.setVisibility(View.GONE); holder.releaseBodyContent.setVisibility(View.GONE);
} }
holder.downloadFrame.setOnClickListener(v -> {
if(holder.downloads.getVisibility() == View.GONE) {
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_down);
holder.downloads.setVisibility(View.VISIBLE);
}
else {
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_right);
holder.downloads.setVisibility(View.GONE);
}
});
holder.releaseZipDownload.setText( holder.releaseZipDownload.setText(
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> ")); Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance()); holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
@ -199,6 +231,9 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> ")); Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance()); holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
ReleasesDownloadsAdapter adapter = new ReleasesDownloadsAdapter(currentItem.getAssets());
holder.downloadList.setAdapter(adapter);
} }
@Override @Override

View File

@ -0,0 +1,68 @@
package org.mian.gitnex.adapters;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import org.mian.gitnex.R;
import org.mian.gitnex.models.Releases;
import java.util.List;
/**
* Author M M Arif
**/
public class ReleasesDownloadsAdapter extends RecyclerView.Adapter<ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder> {
private List<Releases.assetsObject> releasesDownloadsList;
static class ReleasesDownloadsViewHolder extends RecyclerView.ViewHolder {
private TextView downloadName;
private ReleasesDownloadsViewHolder(View itemView) {
super(itemView);
downloadName = itemView.findViewById(R.id.downloadName);
}
}
ReleasesDownloadsAdapter(List<Releases.assetsObject> releasesDownloadsMain) {
this.releasesDownloadsList = releasesDownloadsMain;
}
@NonNull
@Override
public ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_releases_downloads, parent, false);
return new ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder holder, int position) {
Releases.assetsObject currentItem = releasesDownloadsList.get(position);
if(currentItem.getName() != null) {
holder.downloadName.setText(
Html.fromHtml("<a href='" + currentItem.getBrowser_download_url() + "'>" + currentItem.getName() + "</a> "));
holder.downloadName.setMovementMethod(LinkMovementMethod.getInstance());
}
}
@Override
public int getItemCount() {
return releasesDownloadsList.size();
}
}

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#368F73"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#368F73"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
</vector>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/releasePre">
</solid>
<corners
android:radius="3dp">
</corners>
</shape>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@color/releaseStable">
</solid>
<corners
android:radius="3dp">
</corners>
</shape>

View File

@ -1,100 +1,259 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor" > android:orientation="vertical"
android:padding="15dp">
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutFrame" android:id="@+id/headerFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_alignParentTop="true" android:orientation="vertical">
android:orientation="vertical"
android:layout_margin="15dp" >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/releaseTitle" android:id="@+id/releaseName"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_weight=".70"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/releaseTitle" android:layout_weight="1"
android:textIsSelectable="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="18sp" /> android:textSize="18sp"
android:textStyle="bold"
tools:text="3.0.0-rc1" />
<ImageView <TextView
android:id="@+id/releaseType" android:id="@+id/releaseType"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_weight=".30"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_weight="0"
android:scaleType="fitEnd" android:background="@drawable/shape_stable_release"
android:contentDescription="@string/releaseType" android:paddingLeft="5dp"
android:src="@drawable/ic_android" /> android:paddingRight="5dp"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<TextView <LinearLayout
android:id="@+id/releaseTag"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginTop="10dp" android:orientation="horizontal">
android:text="@string/releaseTag"
android:textIsSelectable="true"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp" />
<TextView <LinearLayout
android:id="@+id/releaseDescription" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:gravity="center_vertical"
android:layout_marginTop="10dp" android:orientation="horizontal"
android:text="@string/releaseDescription" tools:ignore="UseCompoundDrawables">
android:textIsSelectable="true"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView <ImageView
android:id="@+id/releaseDownload" android:id="@+id/authorAvatar"
android:layout_width="match_parent" android:layout_width="24dp"
android:layout_height="wrap_content" android:layout_height="24dp"
android:text="@string/releaseDownloadText" tools:srcCompat="@tools:sample/avatars[7]"
android:textIsSelectable="true" android:contentDescription="@string/generalImgContentText" />
android:layout_marginTop="10dp"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp" />
<View <TextView
android:layout_width="match_parent" android:id="@+id/authorName"
android:layout_height="1dp" android:layout_width="wrap_content"
android:id="@+id/divider" android:layout_height="wrap_content"
android:background="?attr/dividerColor" /> android:layout_marginStart="5dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="Published by @mmarif" />
<TextView </LinearLayout>
android:id="@+id/releaseZipDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/releaseZip"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:textColorLink="@color/lightBlue"/>
<TextView <LinearLayout
android:id="@+id/releaseTarDownload" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:gravity="end"
android:text="@string/releaseTar" android:orientation="vertical">
android:layout_marginTop="5dp"
android:textColor="?attr/primaryTextColor" <LinearLayout
android:textSize="16sp" android:layout_width="match_parent"
android:textColorLink="@color/lightBlue"/> android:layout_height="match_parent"
android:gravity="end|center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="18dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_label"
android:contentDescription="@string/generalImgContentText" />
<TextView
android:id="@+id/releaseTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="3.0.0-rc1" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables"
android:visibility="gone">
<ImageView
android:layout_width="18dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_code"
android:contentDescription="@string/generalImgContentText" />
<TextView
android:id="@+id/releaseCommitSha"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="8b1c79c0c3" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="18dp"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_calendar"
android:contentDescription="@string/generalImgContentText" />
<TextView
android:id="@+id/releaseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:singleLine="true"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="1 day ago" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> <LinearLayout
android:id="@+id/bodyFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/releaseBodyContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="Put your release body here" />
</LinearLayout>
<LinearLayout
android:id="@+id/downloadFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/downloadDropdownIcon"
android:layout_width="15dp"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
android:tint="?attr/primaryTextColor"
android:src="@drawable/ic_arrow_right"
app:srcCompat="@drawable/ic_arrow_right" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
android:text="@string/releaseDownloadText"
tools:text="Downloads" />
</LinearLayout>
<RelativeLayout
android:id="@+id/downloads"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
android:paddingTop="8dp">
<TextView
android:id="@+id/releaseZipDownload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:drawableStart="@drawable/ic_file_download_24dp"
android:drawablePadding="8dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="Source code (ZIP)" />
<TextView
android:id="@+id/releaseTarDownload"
android:layout_below="@+id/releaseZipDownload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:drawableStart="@drawable/ic_file_download_24dp"
android:drawablePadding="8dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="Source code (TAR)" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/downloadList"
android:layout_below="@+id/releaseTarDownload"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:scrollbars="vertical" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_marginStart="8dp"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_file_download_24dp"
android:contentDescription="@string/generalImgContentText" />
<TextView
android:id="@+id/downloadName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="Source code (ZIP)" />
</LinearLayout>

View File

@ -17,8 +17,8 @@
<color name="inputBackground">#1d1d1d</color> <color name="inputBackground">#1d1d1d</color>
<color name="toastBackground">#1d1d1d</color> <color name="toastBackground">#1d1d1d</color>
<color name="divider">#1d1d1d</color> <color name="divider">#1d1d1d</color>
<color name="releasePre">#eb7121</color> <color name="releasePre">#f2711c</color>
<color name="releaseStable">#219214</color> <color name="releaseStable">@color/btnBackground</color>
<color name="colorRed">#CC361C</color> <color name="colorRed">#CC361C</color>
<color name="colorLightGreen">#49da39</color> <color name="colorLightGreen">#49da39</color>
<color name="colorDarkGreen">#009486</color> <color name="colorDarkGreen">#009486</color>

View File

@ -216,6 +216,7 @@
<string name="releaseTypeStable" translatable="false">Stable</string> <string name="releaseTypeStable" translatable="false">Stable</string>
<string name="noDataReleasesTab">No releases found</string> <string name="noDataReleasesTab">No releases found</string>
<string name="releaseTag">Tag: %1$s</string> <string name="releaseTag">Tag: %1$s</string>
<string name="releasePublishedBy">Published by @%1$s</string>
<string name="collaboratorsNameToast">Collaborator : %1$s</string> <string name="collaboratorsNameToast">Collaborator : %1$s</string>
<string name="noDataCollaboratorTab">No collaborators found</string> <string name="noDataCollaboratorTab">No collaborators found</string>
@ -492,8 +493,8 @@
<string name="watcherMember">Watcher</string> <string name="watcherMember">Watcher</string>
<string name="commitLinkBranchesTab">Commit</string> <string name="commitLinkBranchesTab">Commit</string>
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string> <string name="zipArchiveDownloadReleasesTab">Source code (ZIP)</string>
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string> <string name="tarArchiveDownloadReleasesTab">Source code (TAR.GZ)</string>
<!-- new file --> <!-- new file -->
<string name="newFileNameTintCopy">File Name</string> <string name="newFileNameTintCopy">File Name</string>