Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Release

See merge request sschueller/peertube!21
  • Loading branch information
sschueller committed Feb 13, 2021
2 parents 0325117 + 1c34556 commit 74bb45a
Show file tree
Hide file tree
Showing 8 changed files with 568 additions and 648 deletions.

This file was deleted.

512 changes: 512 additions & 0 deletions app/src/main/java/net/schueller/peertube/activity/VideoListActivity.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.content.Context;
import android.content.Intent;

import android.util.Log;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
Expand Down Expand Up @@ -74,9 +75,10 @@ public void onBindViewHolder(@NonNull VideoViewHolder holder, int position) {

Picasso.get()
.load(baseUrl + videoList.get(position).getPreviewPath())
.placeholder(R.drawable.test_image)
.error(R.drawable.test_image)
.into(holder.thumb);


Avatar avatar = videoList.get(position).getAccount().getAvatar();
if (avatar != null) {
String avatarPath = avatar.getPath();
Expand Down

This file was deleted.

51 changes: 51 additions & 0 deletions app/src/main/java/net/schueller/peertube/helper/MetaDataHelper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 Stefan Schüller <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.schueller.peertube.helper

import android.content.Context
import android.text.format.DateUtils
import net.schueller.peertube.R.string
import org.ocpsoft.prettytime.PrettyTime
import java.util.Date
import java.util.Locale

object MetaDataHelper {

@JvmStatic
fun getMetaString(getCreatedAt: Date, viewCount: Int, context: Context): String {

// Compatible with SDK 21+
val currentLanguage = Locale.getDefault().displayLanguage
val p = PrettyTime(currentLanguage)
val relativeTime = p.format(Date(getCreatedAt.time))
return relativeTime +
context.resources.getString(string.meta_data_seperator) +
viewCount + context.resources.getString(string.meta_data_views)
}

@JvmStatic
fun getOwnerString(accountName: String, serverHost: String, context: Context): String {
return accountName +
context.resources.getString(string.meta_data_owner_seperator) +
serverHost
}

@JvmStatic
fun getDuration(duration: Long?): String {
return DateUtils.formatElapsedTime(duration!!)
}
}
Binary file added app/src/main/res/drawable/test_image.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_video_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.Toolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
<string name="network_error">Network access error, please check your connectivity</string>
<string name="action_bar_title_server_selection">Select Server</string>
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="action_bar_title_address_book"/>
<string name="action_bar_title_address_book">Address Book</string>
<string name="authentication_login_success">Logged in</string>
<string name="authentication_login_failed">Login Failed!</string>
<string name="server_book_no_servers_found">Server Books is empty</string>
Expand Down

0 comments on commit 74bb45a

Please sign in to comment.