Compare commits

..
38 Commits
Author SHA1 Message Date
Akinwale Ariwodola d918cb28bd sdk 0.81.0 2020-09-11 13:50:16 +01:00
Akinwale Ariwodola 7ce7314ab9 bumpversion 0.16.1 --> 0.16.2 2020-09-11 13:41:30 +01:00
Javi Rueda 13e5caa0ef Use Start/End instead of Left/Right to support RTL (#1005)
* Use Start/End instead of Left/Right to support RTL
* Change it also for relative layout properties
2020-09-11 13:28:37 +01:00
Akinwale Ariwodola ff59a7a89f Merge pull request #1007 from lbryio/first-run-install-id
generate install_id natively
2020-09-11 13:22:42 +01:00
Akinwale Ariwodola c3efa4d004 generate install_id natively 2020-09-10 12:20:49 +01:00
Akinwale Ariwodola ed50e1300a real time notifications over websocket (#1000)
* real time notifications over websocket
* automatically re-establish websocket connections
2020-09-09 14:16:22 +01:00
Akinwale Ariwodola 86dbfd54d1 Merge pull request #1006 from lbryio/notification-back
proper back navigation to the notifications screen
2020-09-09 14:05:29 +01:00
Akinwale Ariwodola 535120eebd proper back navigation to the notifications screen 2020-09-09 14:03:36 +01:00
Akinwale Ariwodola c1106d7186 display correct playback speed for media 2020-09-04 12:50:22 +01:00
Akinwale Ariwodola 45be7f2c9b Merge pull request #1004 from lbryio/player-resume-black-screen
display player view correctly after dismissing PIP view
2020-09-04 12:33:53 +01:00
Akinwale Ariwodola d6baf3d1c8 display player view correctly after dismissing PIP view 2020-09-04 12:32:53 +01:00
Akinwale Ariwodola 08c38c1723 bumpversion 0.16.0 --> 0.16.1 2020-08-28 10:07:20 +01:00
Javi Rueda af4fa454d3 Add setting to enable sending buffering events (#993)
* Add setting to enable sending buffering events
* Use true as default value
2020-08-28 10:06:41 +01:00
Akinwale Ariwodola 0620582a4e fix in-app notification read background in dark mode 2020-08-28 10:04:10 +01:00
Akinwale Ariwodola b11c07e3d1 fix comment redirect from device notifications 2020-08-28 10:00:57 +01:00
Akinwale Ariwodola 593b34079c load notifications after app startup 2020-08-20 20:47:14 +01:00
Akinwale Ariwodola becb533624 fix notification relative time display 2020-08-20 20:32:22 +01:00
Akinwale Ariwodola 8efc0522f2 load unread count after fetching remote notifications 2020-08-20 20:03:30 +01:00
Akinwale Ariwodola cead924ca5 Notification timestamp timezone fix. Tweak loading unread notification count. 2020-08-20 19:56:35 +01:00
Akinwale Ariwodola f83a043664 fix notification sorting 2020-08-20 19:00:21 +01:00
Akinwale Ariwodola e8a0bca5ea tweak equality check for LbryNotification 2020-08-20 18:45:02 +01:00
Akinwale Ariwodola 1198c2298a add and update translations 2020-08-20 18:28:32 +01:00
Akinwale Ariwodola 7205acb9d6 Sort newly added notifications. Add remote loading TTL. 2020-08-20 18:06:35 +01:00
Akinwale Ariwodola d21cfd55ab Handle special URLs from notifications. Disable auto load/play for comment notifications. 2020-08-20 16:39:45 +01:00
Akinwale Ariwodola 47cbc3624c Merge pull request #980 from lbryio/channel-comment-hash
properly handle channel comment notifications
2020-08-20 16:26:08 +01:00
Akinwale Ariwodola 1f9a0886a0 properly handle channel comment notifications 2020-08-20 16:20:46 +01:00
Akinwale Ariwodola dd5ea68915 new YRBL 2020-08-20 14:52:41 +01:00
Akinwale Ariwodola b3bba4d273 Merge pull request #979 from lbryio/is-seen
check is_seen flag. display comment author thumbnails if present.
2020-08-20 13:30:28 +01:00
Akinwale Ariwodola 10c123ba6a check is_seen flag. display comment author thumbnails if present. 2020-08-20 13:26:41 +01:00
Akinwale Ariwodola a8ba45b941 bumpversion 0.15.17 --> 0.16.0 2020-08-19 18:18:37 +01:00
Akinwale Ariwodola 3652cdf6bc CI apt-transport-https 2020-08-19 18:14:13 +01:00
Akinwale Ariwodola f2a7a8c439 cleanup: yarn.lock 2020-08-19 18:10:57 +01:00
Akinwale Ariwodola 78d5a99441 Gradle fix (#978) 2020-08-19 18:09:37 +01:00
Akinwale Ariwodola 6931dbe79c Instant verification (#974)
* add instant verification options and Google Play Billing
bumpversion 0.15.16 --> 0.15.17
restore account_undergo_review default string
twitter sign-in flow
fix build error
final changes
update api key and secret
* tweak build script
2020-08-19 17:23:35 +01:00
Akinwale Ariwodola 4d024c06cc In-app notifications (#969)
* display notification bell icon beside URL bar
* notification model
* persist received notifications
* Refresh notification list. Add  is_read flag and display unread count.
* Hide notifications when opening the navigatinon drawer. Open selected notification item before hiding the list.
* update local store with remote notifications
* use card view for notification items
* make notification cards clickable
* handle comment hash
* fix remote notifications not loading. fix comment scroll.
* Improve in-app comment notification linking. Add icons.
2020-08-18 14:19:35 +01:00
Akinwale Ariwodola ddcb190457 do not display global background servce initializing indicator 2020-08-07 10:11:57 +01:00
Akinwale Ariwodola dd14b90d7e Merge pull request #967 from kekkyojin/sendto-feat
Allow to publish files via Send To feature
2020-07-29 15:20:59 +01:00
Javi Rueda feb7f260dc Allow to publish files via Send To feature 2020-07-24 01:59:59 +02:00
139 changed files with 7464 additions and 1314 deletions

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ buck-out/
# Other Files
app/google-services.json
app/twitter.properties
*.log
.vagrant
*.hprof
+21 -13
View File
@@ -8,10 +8,13 @@ build apk:
stage: build
image: lbry/android-base:platform-28
before_script:
- apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign git-secret
- git secret reveal
- chmod u+x $CI_PROJECT_DIR/gradlew
- export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1)
artifacts:
paths:
- bin/browser-*-release__arm.apk
@@ -19,12 +22,7 @@ build apk:
expire_in: 1 week
script:
- export PATH=/usr/bin:$PATH
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install git-secret
- git secret reveal
- yarn
- export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23
- chmod u+x ./release.sh
- ./release.sh
- cp bin/browser-$BUILD_VERSION-release__arm.apk /dev/null
@@ -36,10 +34,15 @@ deploy build.lbry.io:
dependencies:
- build apk
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
- apt-get -y update && apt-get -y install apt-transport-https
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install openjdk-8-jdk git git-secret
- pip install awscli
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
- git secret reveal
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1)
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
@@ -55,10 +58,15 @@ release apk:
dependencies:
- build apk
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
- apt-get -y update && apt-get -y install apt-transport-https
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install openjdk-8-jdk git git-secret
- pip install awscli githubrelease
- git secret reveal
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -p $CI_PROJECT_DIR -q printVersionName --console=plain | tail -1)
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
script:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -1,2 +1,3 @@
lbry-android.keystore:0d958c531870694624cc877ea98ca1c583485f8ebbb3a5acca58b1930c190d65
app/google-services.json:896a0bee8294a36d061f10fa926129d8a780528b34d0a2f03113400c4246d67c
app/twitter.properties:01212d70712f2041efb5c814bf30ecbf6f72e1ca5179c7647c4f8cbd995dd033
+31 -4
View File
@@ -16,12 +16,16 @@ android {
applicationId "io.lbry.browser"
minSdkVersion 21
targetSdkVersion 29
versionCode 1516
versionName "0.15.16"
versionCode 1602
versionName "0.16.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
productFlavors {
__32bit {
versionCode android.defaultConfig.versionCode * 10 + 1
@@ -38,7 +42,17 @@ android {
}
buildTypes {
debug {
Properties twitterProps = new Properties()
twitterProps.load(project.file('twitter.properties').newDataInputStream())
resValue "string", "TWITTER_CONSUMER_KEY", "\"${twitterProps.getProperty("twitterConsumerKey")}\""
resValue "string", "TWITTER_CONSUMER_SECRET", "\"${twitterProps.getProperty("twitterConsumerSecret")}\""
}
release {
Properties twitterProps = new Properties()
twitterProps.load(project.file('twitter.properties').newDataInputStream())
resValue "string", "TWITTER_CONSUMER_KEY", "\"${twitterProps.getProperty("twitterConsumerKey")}\""
resValue "string", "TWITTER_CONSUMER_SECRET", "\"${twitterProps.getProperty("twitterConsumerSecret")}\""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
@@ -51,6 +65,13 @@ task printVersionName {
}
}
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
@@ -76,6 +97,9 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics:17.4.2'
implementation 'com.google.android.gms:play-services-base:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.oauth-client:google-oauth-client:1.30.4'
implementation 'com.android.billingclient:billing:3.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.4'
@@ -93,6 +117,9 @@ dependencies {
implementation 'com.arthenica:mobile-ffmpeg-full-gpl:4.3.1.LTS'
implementation 'org.bitcoinj:bitcoinj-tools:0.14.7'
implementation 'org.java-websocket:Java-WebSocket:1.5.1'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
@@ -101,8 +128,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
__32bitImplementation 'io.lbry:lbrysdk32:0.79.1'
__64bitImplementation 'io.lbry:lbrysdk64:0.79.1'
__32bitImplementation 'io.lbry:lbrysdk32:0.81.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.81.0'
}
apply plugin: 'com.google.gms.google-services'
Binary file not shown.
+8
View File
@@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<application
android:allowBackup="true"
@@ -50,6 +51,13 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="text/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
@@ -15,12 +15,22 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.text.HtmlCompat;
import androidx.preference.PreferenceManager;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import io.lbry.browser.exceptions.AuthTokenInvalidatedException;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbry;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.browser.utils.Lbryio;
import io.lbry.lbrysdk.LbrynetService;
import io.lbry.lbrysdk.ServiceHelper;
import io.lbry.lbrysdk.Utils;
public class FirstRunActivity extends AppCompatActivity {
@@ -44,12 +54,7 @@ public class FirstRunActivity extends AppCompatActivity {
});
registerAuthReceiver();
if (!Lbry.SDK_READY) {
findViewById(R.id.welcome_wait_container).setVisibility(View.VISIBLE);
} else {
authenticate();
}
findViewById(R.id.welcome_wait_container).setVisibility(View.VISIBLE);
IntentFilter filter = new IntentFilter();
filter.addAction(MainActivity.ACTION_SDK_READY);
filter.addAction(LbrynetService.ACTION_STOP_SERVICE);
@@ -62,10 +67,38 @@ public class FirstRunActivity extends AppCompatActivity {
authenticate();
} else if (LbrynetService.ACTION_STOP_SERVICE.equals(action)) {
finish();
if (MainActivity.instance != null) {
MainActivity.instance.finish();
}
}
}
};
registerReceiver(sdkReceiver, filter);
CheckInstallIdTask task = new CheckInstallIdTask(this, new CheckInstallIdTask.InstallIdHandler() {
@Override
public void onInstallIdChecked(boolean result) {
// start the sdk from FirstRun
boolean serviceRunning = MainActivity.isServiceRunning(MainActivity.instance, LbrynetService.class);
if (!serviceRunning) {
Lbry.SDK_READY = false;
ServiceHelper.start(MainActivity.instance, "", LbrynetService.class, "lbrynetservice");
}
if (result) {
// install_id generated and validated, authenticate now
authenticate();
return;
}
// we weren't able to generate the install_id ourselves, depend on the sdk for that
if (Lbry.SDK_READY) {
authenticate();
return;
}
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void onResume() {
@@ -134,6 +167,75 @@ public class FirstRunActivity extends AppCompatActivity {
super.onDestroy();
}
private void generateIdAndAuthenticate() {
}
private static class CheckInstallIdTask extends AsyncTask<Void, Void, Boolean> {
private Context context;
private InstallIdHandler handler;
public CheckInstallIdTask(Context context, InstallIdHandler handler) {
this.context = context;
this.handler = handler;
}
protected Boolean doInBackground(Void... params) {
// Load the installation id from the file system
String lbrynetDir = String.format("%s/%s", Utils.getAppInternalStorageDir(context), "lbrynet");
File dir = new File(lbrynetDir);
boolean dirExists = dir.isDirectory();
if (!dirExists) {
dirExists = dir.mkdirs();
}
if (!dirExists) {
return false;
}
String installIdPath = String.format("%s/install_id", lbrynetDir);
File file = new File(installIdPath);
String installId = null;
if (!file.exists()) {
// generate the install_id
installId = Lbry.generateId();
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter(file));
writer.write(installId);
android.util.Log.d("LbryMain", "Generated install ID=" + installId);
} catch (IOException ex) {
return false;
} finally {
Helper.closeCloseable(writer);
}
} else {
// read the installation id from the file
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(installIdPath)));
installId = reader.readLine();
} catch (IOException ex) {
return false;
} finally {
Helper.closeCloseable(reader);
}
}
if (!Helper.isNullOrEmpty(installId)) {
Lbry.INSTALLATION_ID = installId;
}
return !Helper.isNullOrEmpty(installId);
}
protected void onPostExecute(Boolean result) {
if (handler != null) {
handler.onInstallIdChecked(result);
}
}
public interface InstallIdHandler {
void onInstallIdChecked(boolean result);
}
}
private static class AuthenticateTask extends AsyncTask<Void, Void, Void> {
private Context context;
public AuthenticateTask(Context context) {
@@ -6,6 +6,7 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
@@ -20,19 +21,22 @@ import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import io.lbry.browser.data.DatabaseHelper;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryAnalytics;
import io.lbry.lbrysdk.LbrynetService;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class LbrynetMessagingService extends FirebaseMessagingService {
public static final String ACTION_NOTIFICATION_RECEIVED = "io.lbry.browser.Broadcast.NotificationReceived";
private static final String TAG = "LbrynetMessagingService";
private static final String NOTIFICATION_CHANNEL_ID = "io.lbry.browser.LBRY_ENGAGEMENT_CHANNEL";
private static final String TYPE_COMMENT = "comment";
private static final String TYPE_SUBSCRIPTION = "subscription";
private static final String TYPE_REWARD = "reward";
private static final String TYPE_INTERESTS = "interests";
@@ -52,10 +56,7 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
String title = payload.get("title");
String body = payload.get("body");
String name = payload.get("name"); // notification name
String contentTitle = payload.get("content_title");
String channelUrl = payload.get("channel_url");
//String publishTime = payload.get("publish_time");
String publishTime = null;
String hash = payload.get("hash"); // comment hash
if (type != null && getEnabledTypes().indexOf(type) > -1 && body != null && body.trim().length() > 0) {
// only log the receive event for valid notifications received
@@ -65,7 +66,34 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
firebaseAnalytics.logEvent(LbryAnalytics.EVENT_LBRY_NOTIFICATION_RECEIVE, bundle);
}
sendNotification(title, body, type, url, name, contentTitle, channelUrl, publishTime);
if (!Helper.isNullOrEmpty(hash)) {
url = String.format("%s?comment_hash=%s", url, hash);
}
sendNotification(title, body, type, url, name);
}
// persist the notification data
try {
DatabaseHelper helper = DatabaseHelper.getInstance();
SQLiteDatabase db = helper.getWritableDatabase();
LbryNotification lnotification = new LbryNotification();
lnotification.setTitle(title);
lnotification.setDescription(body);
lnotification.setTargetUrl(url);
lnotification.setTimestamp(new Date());
DatabaseHelper.createOrUpdateNotification(lnotification, db);
// send a broadcast
Intent intent = new Intent(ACTION_NOTIFICATION_RECEIVED);
intent.putExtra("title", title);
intent.putExtra("body", body);
intent.putExtra("url", url);
intent.putExtra("timestamp", lnotification.getTimestamp().getTime());
sendBroadcast(intent);
} catch (Exception ex) {
// don't fail if any error occurs while saving a notification
Log.e(TAG, "could not save notification", ex);
}
}
}
@@ -97,8 +125,7 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
*
* @param messageBody FCM message body received.
*/
private void sendNotification(String title, String messageBody, String type, String url, String name,
String contentTitle, String channelUrl, String publishTime) {
private void sendNotification(String title, String messageBody, String type, String url, String name) {
//Intent intent = new Intent(this, MainActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (url == null) {
@@ -143,6 +170,9 @@ public class LbrynetMessagingService extends FirebaseMessagingService {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
List<String> enabledTypes = new ArrayList<String>();
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_COMMENTS, true)) {
enabledTypes.add(TYPE_COMMENT);
}
if (sp.getBoolean(MainActivity.PREFERENCE_KEY_NOTIFICATION_SUBSCRIPTIONS, true)) {
enabledTypes.add(TYPE_SUBSCRIPTION);
}
@@ -8,6 +8,7 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -46,6 +47,13 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingClientStateListener;
import com.android.billingclient.api.BillingResult;
import com.android.billingclient.api.ConsumeParams;
import com.android.billingclient.api.ConsumeResponseListener;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.PurchasesUpdatedListener;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
@@ -90,6 +98,8 @@ import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -99,6 +109,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.URI;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -114,6 +125,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import io.lbry.browser.adapter.NavigationMenuAdapter;
import io.lbry.browser.adapter.NotificationListAdapter;
import io.lbry.browser.adapter.UrlSuggestionListAdapter;
import io.lbry.browser.data.DatabaseHelper;
import io.lbry.browser.dialog.ContentScopeDialogFragment;
@@ -136,16 +148,22 @@ import io.lbry.browser.model.Tag;
import io.lbry.browser.model.UrlSuggestion;
import io.lbry.browser.model.WalletBalance;
import io.lbry.browser.model.WalletSync;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.model.lbryinc.Reward;
import io.lbry.browser.model.lbryinc.RewardVerified;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.tasks.GenericTaskHandler;
import io.lbry.browser.tasks.RewardVerifiedHandler;
import io.lbry.browser.tasks.claim.ClaimListResultHandler;
import io.lbry.browser.tasks.claim.ClaimListTask;
import io.lbry.browser.tasks.lbryinc.AndroidPurchaseTask;
import io.lbry.browser.tasks.lbryinc.ClaimRewardTask;
import io.lbry.browser.tasks.lbryinc.FetchRewardsTask;
import io.lbry.browser.tasks.LighthouseAutoCompleteTask;
import io.lbry.browser.tasks.MergeSubscriptionsTask;
import io.lbry.browser.tasks.claim.ResolveTask;
import io.lbry.browser.tasks.lbryinc.NotificationListTask;
import io.lbry.browser.tasks.lbryinc.NotificationUpdateTask;
import io.lbry.browser.tasks.localdata.FetchRecentUrlHistoryTask;
import io.lbry.browser.tasks.wallet.DefaultSyncTaskHandler;
import io.lbry.browser.tasks.wallet.LoadSharedUserStateTask;
@@ -184,10 +202,19 @@ import io.lbry.lbrysdk.ServiceHelper;
import io.lbry.lbrysdk.Utils;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import okhttp3.OkHttpClient;
public class MainActivity extends AppCompatActivity implements SdkStatusListener {
private static final String CHANNEL_ID_PLAYBACK = "io.lbry.browser.LBRY_PLAYBACK_CHANNEL";
private static final int PLAYBACK_NOTIFICATION_ID = 3;
private static final String SPECIAL_URL_PREFIX = "lbry://?";
private static final int REMOTE_NOTIFICATION_REFRESH_TTL = 300000; // 5 minutes
public static final String SKU_SKIP = "lbryskip";
public static MainActivity instance;
private boolean shuttingDown;
private Date remoteNotifcationsLastLoaded;
private Map<String, Class> specialRouteFragmentClassMap;
@Getter
private boolean inPictureInPictureMode;
@@ -209,7 +236,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public static boolean startingPermissionRequest = false;
public static boolean startingSignInFlowActivity = false;
private BillingClient billingClient;
@Getter
private boolean enteringPIPMode = false;
private boolean fullSyncInProgress = false;
@@ -219,10 +246,13 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
@Setter
private BackPressInterceptor backPressInterceptor;
private WebSocketClient webSocketClient;
@Getter
private String firebaseMessagingToken;
private NotificationListAdapter notificationListAdapter;
private Map<String, Fragment> openNavFragments;
private static final Map<Class, Integer> fragmentClassNavIdMap = new HashMap<>();
static {
@@ -281,12 +311,14 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public static final String PREFERENCE_KEY_DARK_MODE = "io.lbry.browser.preference.userinterface.DarkMode";
public static final String PREFERENCE_KEY_SHOW_MATURE_CONTENT = "io.lbry.browser.preference.userinterface.ShowMatureContent";
public static final String PREFERENCE_KEY_SHOW_URL_SUGGESTIONS = "io.lbry.browser.preference.userinterface.UrlSuggestions";
public static final String PREFERENCE_KEY_NOTIFICATION_COMMENTS = "io.lbry.browser.preference.notifications.Comments";
public static final String PREFERENCE_KEY_NOTIFICATION_SUBSCRIPTIONS = "io.lbry.browser.preference.notifications.Subscriptions";
public static final String PREFERENCE_KEY_NOTIFICATION_REWARDS = "io.lbry.browser.preference.notifications.Rewards";
public static final String PREFERENCE_KEY_NOTIFICATION_CONTENT_INTERESTS = "io.lbry.browser.preference.notifications.ContentInterests";
public static final String PREFERENCE_KEY_NOTIFICATION_CREATOR = "io.lbry.browser.preference.notifications.Creator";
public static final String PREFERENCE_KEY_KEEP_SDK_BACKGROUND = "io.lbry.browser.preference.other.KeepSdkInBackground";
public static final String PREFERENCE_KEY_PARTICIPATE_DATA_NETWORK = "io.lbry.browser.preference.other.ParticipateInDataNetwork";
public static final String PREFERENCE_KEY_SEND_BUFFERING_EVENTS = "io.lbry.browser.preference.other.SendBufferingEvents";
// Internal flags / setting preferences
public static final String PREFERENCE_KEY_INTERNAL_SKIP_WALLET_ACCOUNT = "io.lbry.browser.preference.internal.WalletSkipAccount";
@@ -362,6 +394,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
@Override
protected void onCreate(Bundle savedInstanceState) {
instance = this;
// workaround to fix dark theme because https://issuetracker.google.com/issues/37124582
try {
new WebView(this);
@@ -401,6 +434,24 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// setup the billing client in main activity (to handle cases where the verification purchase flow may have been interrupted)
billingClient = BillingClient.newBuilder(this)
.setListener(new PurchasesUpdatedListener() {
@Override
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
int responseCode = billingResult.getResponseCode();
if (responseCode == BillingClient.BillingResponseCode.OK && purchases != null)
{
for (Purchase purchase : purchases) {
handlePurchase(purchase);
}
}
}
})
.enablePendingPurchases()
.build();
establishBillingClientConnection();
playerNotificationManager = new PlayerNotificationManager(
this, LbrynetService.NOTIFICATION_CHANNEL_ID, PLAYBACK_NOTIFICATION_ID, new PlayerNotificationDescriptionAdapter());
@@ -438,6 +489,8 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
// setup uri bar
setupUriBar();
initNotificationsPage();
loadUnreadNotificationsCount();
// other
pendingSyncSetQueue = new ArrayList<>();
@@ -474,6 +527,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public void onDrawerSlide(View drawerView, float slideOffset) {
if (slideOffset != 0) {
clearWunderbarFocus(findViewById(R.id.wunderbar));
hideNotifications();
}
super.onDrawerSlide(drawerView, slideOffset);
}
@@ -502,10 +556,23 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
}
});
findViewById(R.id.wunderbar_notifications).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
View container = findViewById(R.id.notifications_container);
if (container.getVisibility() != View.VISIBLE) {
showNotifications();
} else {
hideNotifications();
}
}
});
findViewById(R.id.global_now_playing_card).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (nowPlayingClaim != null && !Helper.isNullOrEmpty(nowPlayingClaimUrl)) {
hideNotifications();
openFileUrl(nowPlayingClaimUrl);
}
}
@@ -550,7 +617,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public boolean isBackgroundPlaybackEnabled() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
return sp.getBoolean(PREFERENCE_KEY_BACKGROUND_PLAYBACK, false);
return sp.getBoolean(PREFERENCE_KEY_BACKGROUND_PLAYBACK, true);
}
public boolean initialSubscriptionMergeDone() {
@@ -579,6 +646,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
checkSendToIntent(intent);
checkUrlIntent(intent);
checkNotificationOpenIntent(intent);
}
@@ -715,8 +783,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
}
private void openSelectedMenuItem() {
hideNotifications();
switch (selectedMenuItemId) {
// TODO: reverse map lookup for class?
case NavMenuItem.ID_ITEM_FOLLOWING:
openFragment(FollowingFragment.class, true, NavMenuItem.ID_ITEM_FOLLOWING);
break;
@@ -802,12 +871,18 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
openFragment(PublishFormFragment.class, true, NavMenuItem.ID_ITEM_NEW_PUBLISH, params);
}
public void openChannelUrl(String url) {
public void openChannelUrl(String url, String source) {
Map<String, Object> params = new HashMap<>();
params.put("url", url);
params.put("claim", getCachedClaimForUrl(url));
if (!Helper.isNullOrEmpty(source)) {
params.put("source", source);
}
openFragment(ChannelFragment.class, true, NavMenuItem.ID_ITEM_FOLLOWING, params);
}
public void openChannelUrl(String url) {
openChannelUrl(url, null);
}
private Claim getCachedClaimForUrl(String url) {
ClaimCacheKey key = new ClaimCacheKey();
@@ -828,11 +903,44 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
}
public void openFileUrl(String url) {
openFileUrl(url, null);
}
public void openFileUrl(String url, String source) {
Map<String, Object> params = new HashMap<>();
params.put("url", url);
if (!Helper.isNullOrEmpty(source)) {
params.put("source", source);
}
openFragment(FileViewFragment.class, true, NavMenuItem.ID_ITEM_FOLLOWING, params);
}
private void openSpecialUrl(String url, String source) {
String specialPath = url.substring(8).toLowerCase();
if (specialRouteFragmentClassMap.containsKey(specialPath)) {
Class fragmentClass = specialRouteFragmentClassMap.get(specialPath);
if (fragmentClassNavIdMap.containsKey(fragmentClass)) {
Map<String, Object> params = null;
if (!Helper.isNullOrEmpty(source)) {
params = new HashMap<>();
params.put("source", source);
}
openFragment(
specialRouteFragmentClassMap.get(specialPath),
true,
fragmentClassNavIdMap.get(fragmentClass),
params
);
}
}
}
public void openSendTo(String path) {
Map<String, Object> params = new HashMap<>();
params.put("directFilePath", path);
openFragment(PublishFormFragment.class, true, NavMenuItem.ID_ITEM_NEW_PUBLISH, params);
}
public void openFileClaim(Claim claim) {
Map<String, Object> params = new HashMap<>();
params.put("claimId", claim.getClaimId());
@@ -868,7 +976,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
findViewById(R.id.content_main).setVisibility(View.GONE);
findViewById(R.id.floating_balance_main_container).setVisibility(View.GONE);
findViewById(R.id.global_now_playing_card).setVisibility(View.GONE);
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
//findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
findViewById(R.id.app_bar_main_container).setFitsSystemWindows(true);
hideActionBar();
@@ -904,9 +1012,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
if (!(fragment instanceof FileViewFragment) && !inFullscreenMode) {
findViewById(R.id.global_now_playing_card).setVisibility(View.VISIBLE);
}
if (!Lbry.SDK_READY && !inFullscreenMode) {
/*if (!Lbry.SDK_READY && !inFullscreenMode) {
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.VISIBLE);
}
}*/
for (PIPModeListener listener : pipModeListeners) {
listener.onExitPIPMode();
}
@@ -920,11 +1028,15 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
@Override
protected void onDestroy() {
shuttingDown = true;
unregisterReceivers();
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
if (receivedStopService || !isServiceRunning(this, LbrynetService.class)) {
notificationManager.cancelAll();
}
if (webSocketClient != null) {
webSocketClient.close();
}
if (dbHelper != null) {
dbHelper.close();
}
@@ -990,31 +1102,96 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@SneakyThrows
private void checkWebSocketClient() {
if ((webSocketClient == null || webSocketClient.isClosed()) && !Helper.isNullOrEmpty(Lbryio.AUTH_TOKEN)) {
webSocketClient = new WebSocketClient(new URI(String.format("%s%s", Lbryio.WS_CONNECTION_BASE_URL, Lbryio.AUTH_TOKEN))) {
@Override
public void onOpen(ServerHandshake handshakedata) { }
@Override
public void onMessage(String message) {
loadRemoteNotifications(false);
}
@Override
public void onClose(int code, String reason, boolean remote) {
if (!shuttingDown) {
// attempt to re-establish the connection if the app isn't being closed
checkWebSocketClient();
}
}
@Override
public void onError(Exception ex) { }
};
webSocketClient.connect();
}
}
@Override
protected void onResume() {
super.onResume();
checkPurchases();
checkWebSocketClient();
enteringPIPMode = false;
applyNavbarSigninPadding();
checkFirstRun();
checkNowPlaying();
// check (and start) the LBRY SDK service
serviceRunning = isServiceRunning(this, LbrynetService.class);
if (!serviceRunning) {
Lbry.SDK_READY = false;
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.VISIBLE);
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
if (isFirstRunCompleted()) {
// check (and start) the LBRY SDK service
serviceRunning = isServiceRunning(this, LbrynetService.class);
if (!serviceRunning) {
Lbry.SDK_READY = false;
//findViewById(R.id.global_sdk_initializing_status).setVisibility(View.VISIBLE);
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
}
}
checkSdkReady();
showSignedInUser();
checkPendingOpens();
if (Lbry.SDK_READY) {
/*if (Lbry.SDK_READY) {
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
}*/
}
public boolean isFirstRunCompleted() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
return sp.getBoolean(PREFERENCE_KEY_INTERNAL_FIRST_RUN_COMPLETED, false);
}
private void checkPurchases() {
if (billingClient != null) {
Purchase.PurchasesResult result = billingClient.queryPurchases(BillingClient.SkuType.INAPP);
if (result.getPurchasesList() != null) {
for (Purchase purchase : result.getPurchasesList()) {
handlePurchase(purchase);
}
}
}
}
private void handlePurchase(Purchase purchase) {
handleBillingPurchase(purchase, billingClient, MainActivity.this, null, new RewardVerifiedHandler() {
@Override
public void onSuccess(RewardVerified rewardVerified) {
if (Lbryio.currentUser != null) {
Lbryio.currentUser.setRewardApproved(rewardVerified.isRewardApproved());
}
}
@Override
public void onError(Exception error) {
// pass
}
});
}
private void checkPendingOpens() {
if (pendingFollowingReload) {
loadFollowingContent();
@@ -1059,7 +1236,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
View container = findViewById(R.id.url_suggestions_container);
View closeIcon = findViewById(R.id.wunderbar_close);
EditText wunderbar = findViewById(R.id.wunderbar);
wunderbar.setPadding(0, 0, visible ? getScaledValue(36) : 0, 0);
//wunderbar.setPadding(0, 0, visible ? getScaledValue(36) : 0, 0);
container.setVisibility(visible ? View.VISIBLE : View.GONE);
closeIcon.setVisibility(visible ? View.VISIBLE : View.GONE);
@@ -1094,8 +1271,13 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (hasFocus) {
hideNotifications();
findViewById(R.id.wunderbar_notifications).setVisibility(View.INVISIBLE);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, 0);
} else {
findViewById(R.id.wunderbar_notifications).setVisibility(View.VISIBLE);
}
if (canShowUrlSuggestions()) {
@@ -1443,7 +1625,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
if (actionBar != null) {
actionBar.hide();
}
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
//findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
findViewById(R.id.app_bar_main_container).setFitsSystemWindows(false);
lockDrawer();
@@ -1474,9 +1656,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
appBarMainContainer.setFitsSystemWindows(true);
decorView.setSystemUiVisibility(flags);
if (!Lbry.SDK_READY) {
/*if (!Lbry.SDK_READY) {
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.VISIBLE);
}
}*/
showFloatingWalletBalance();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
@@ -1565,7 +1747,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
checkSyncedWallet();
}
findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
//findViewById(R.id.global_sdk_initializing_status).setVisibility(View.GONE);
scheduleWalletBalanceUpdate();
scheduleWalletSyncTask();
@@ -1625,8 +1807,13 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
mediaSession.setActive(true);
}
private static final String CHANNEL_ID_PLAYBACK = "io.lbry.browser.LBRY_PLAYBACK_CHANNEL";
private static final int PLAYBACK_NOTIFICATION_ID = 3;
public void initNotificationsPage() {
findViewById(R.id.notification_list_empty_container).setVisibility(View.VISIBLE);
RecyclerView notificationsList = findViewById(R.id.notifications_list);
LinearLayoutManager llm = new LinearLayoutManager(this);
notificationsList.setLayoutManager(llm);
}
public void initPlaybackNotification() {
if (isBackgroundPlaybackEnabled()) {
@@ -1998,6 +2185,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
intentFilter.addAction(ACTION_OPEN_REWARDS_PAGE);
intentFilter.addAction(ACTION_PUBLISH_SUCCESSFUL);
intentFilter.addAction(ACTION_SAVE_SHARED_USER_STATE);
intentFilter.addAction(LbrynetMessagingService.ACTION_NOTIFICATION_RECEIVED);
requestsReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -2018,9 +2206,15 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
saveSharedUserState();
} else if (ACTION_PUBLISH_SUCCESSFUL.equalsIgnoreCase(action)) {
openPublishesOnSuccessfulPublish();
} else if (LbrynetMessagingService.ACTION_NOTIFICATION_RECEIVED.equalsIgnoreCase(action)) {
handleNotificationReceived(intent);
}
}
private void handleNotificationReceived(Intent intent) {
loadRemoteNotifications(false);
}
private void handleAuthTokenGenerated(Intent intent) {
// store the value
String encryptedAuthToken = intent.getStringExtra("authToken");
@@ -2063,13 +2257,72 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
public void showNotifications() {
clearWunderbarFocus(findViewById(R.id.wunderbar));
findViewById(R.id.notifications_container).setVisibility(View.VISIBLE);
((ImageView) findViewById(R.id.notifications_toggle_icon)).setColorFilter(ContextCompat.getColor(this, R.color.lbryGreen));
if (remoteNotifcationsLastLoaded == null ||
(System.currentTimeMillis() - remoteNotifcationsLastLoaded.getTime() > REMOTE_NOTIFICATION_REFRESH_TTL)) {
loadRemoteNotifications(true);
}
if (notificationListAdapter != null) {
markNotificationsRead();
}
}
public void hideNotifications() {
((ImageView) findViewById(R.id.notifications_toggle_icon)).setColorFilter(ContextCompat.getColor(this, R.color.actionBarForeground));
findViewById(R.id.notifications_container).setVisibility(View.GONE);
}
private void markNotificationsRead() {
List<LbryNotification> all = notificationListAdapter != null ? notificationListAdapter.getItems() : null;
if (all != null) {
List<Long> unreadIds = new ArrayList<>();
for (LbryNotification notification : all) {
if (!notification.isRead() && notification.getRemoteId() > 0) {
unreadIds.add(notification.getRemoteId());
}
}
if (unreadIds.size() > 0) {
NotificationUpdateTask task = new NotificationUpdateTask(unreadIds, true);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
(new AsyncTask<Void, Void, Void>() {
protected Void doInBackground(Void... params) {
try {
SQLiteDatabase db = dbHelper.getWritableDatabase();
DatabaseHelper.markNotificationsRead(db);
} catch (Exception ex) {
// pass
}
return null;
}
protected void onPostExecute(Void result) {
loadUnreadNotificationsCount();
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void navigateBackToNotifications() {
showNotifications();
}
@Override
public void onBackPressed() {
if (findViewById(R.id.url_suggestions_container).getVisibility() == View.VISIBLE) {
clearWunderbarFocus(findViewById(R.id.wunderbar));
return;
}
if (findViewById(R.id.notifications_container).getVisibility() == View.VISIBLE) {
hideNotifications();
return;
}
if (backPressInterceptor != null && backPressInterceptor.onBackPressed()) {
return;
}
@@ -2437,8 +2690,8 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
startupStages.put(STARTUP_STAGE_SUBSCRIPTIONS_RESOLVED, true);
}
} catch (Exception ex) {
// nope
android.util.Log.e(TAG, String.format("App startup failed: %s", ex.getMessage()), ex);
// nopecd
Log.e(TAG, String.format("App startup failed: %s", ex.getMessage()), ex);
return false;
} finally {
Helper.closeCloseable(reader);
@@ -2465,8 +2718,10 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
loadLastFragment();
showSignedInUser();
fetchRewards();
loadRemoteNotifications(false);
checkUrlIntent(getIntent());
checkWebSocketClient();
LbryAnalytics.logEvent(LbryAnalytics.EVENT_APP_LAUNCH);
appStarted = true;
}
@@ -2526,7 +2781,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
if (data != null) {
String url = data.toString();
// check special urls
if (url.startsWith("lbry://?")) {
if (url.startsWith(SPECIAL_URL_PREFIX)) {
String specialPath = url.substring(8).toLowerCase();
if (specialRouteFragmentClassMap.containsKey(specialPath)) {
Class fragmentClass = specialRouteFragmentClassMap.get(specialPath);
@@ -2549,9 +2804,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
try {
LbryUri uri = LbryUri.parse(url);
if (uri.isChannel()) {
openChannelUrl(uri.toString());
openChannelUrl(url);
} else {
openFileUrl(uri.toString());
openFileUrl(url);
}
} catch (LbryUriException ex) {
// pass
@@ -2644,6 +2899,19 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
LbryAnalytics.logEvent(LbryAnalytics.EVENT_LBRY_NOTIFICATION_OPEN, bundle);
}
private void checkSendToIntent(Intent intent) {
String intentAction = intent.getAction();
if (intentAction != null && intentAction.equals("android.intent.action.SEND")) {
ClipData clipData = intent.getClipData();
if (clipData != null) {
Uri uri = clipData.getItemAt(0).getUri();
String path = Helper.getRealPathFromURI_API19(this, uri);
openSendTo(path);
}
}
}
private void registerServiceActionsReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(DownloadManager.ACTION_DOWNLOAD_EVENT);
@@ -2900,6 +3168,9 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
if (appPlayer != null && inPictureInPictureMode && !isBackgroundPlaybackEnabled()) {
appPlayer.setPlayWhenReady(false);
}
if (inPictureInPictureMode) {
MainActivity.playerReassigned = true;
}
super.onStop();
}
@@ -3030,6 +3301,155 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void displayUnreadNotificationCount(int count) {
String text = count > 99 ? "99+" : String.valueOf(count);
TextView badge = findViewById(R.id.notifications_badge_count);
badge.setVisibility(count > 0 ? View.VISIBLE : View.INVISIBLE);
badge.setText(text);
}
private void loadUnreadNotificationsCount() {
(new AsyncTask<Void, Void, Integer>() {
@Override
protected Integer doInBackground(Void... params) {
try {
SQLiteDatabase db = dbHelper.getReadableDatabase();
return DatabaseHelper.getUnreadNotificationsCount(db);
} catch (Exception ex) {
return 0;
}
}
protected void onPostExecute(Integer count) {
displayUnreadNotificationCount(count);
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void loadRemoteNotifications(boolean markRead) {
findViewById(R.id.notification_list_empty_container).setVisibility(View.GONE);
NotificationListTask task = new NotificationListTask(this, findViewById(R.id.notifications_progress), new NotificationListTask.ListNotificationsHandler() {
@Override
public void onSuccess(List<LbryNotification> notifications) {
remoteNotifcationsLastLoaded = new Date();
loadUnreadNotificationsCount();
loadLocalNotifications();
if (markRead && findViewById(R.id.notifications_container).getVisibility() == View.VISIBLE) {
markNotificationsRead();
}
}
@Override
public void onError(Exception exception) {
// pass
Log.e(TAG, "error loading remote notifications", exception);
loadLocalNotifications();
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void loadLocalNotifications() {
(new AsyncTask<Void, Void, List<LbryNotification>>() {
protected void onPreExecute() {
findViewById(R.id.notification_list_empty_container).setVisibility(View.GONE);
findViewById(R.id.notifications_progress).setVisibility(View.VISIBLE);
}
@Override
protected List<LbryNotification> doInBackground(Void... params) {
List<LbryNotification> notifications = new ArrayList<>();
try {
SQLiteDatabase db = dbHelper.getReadableDatabase();
notifications = DatabaseHelper.getNotifications(db);
} catch (Exception ex) {
// pass
}
return notifications;
}
protected void onPostExecute(List<LbryNotification> notifications) {
findViewById(R.id.notification_list_empty_container).setVisibility(notifications.size() == 0 ? View.VISIBLE : View.GONE);
findViewById(R.id.notifications_progress).setVisibility(View.GONE);
loadUnreadNotificationsCount();
if (notificationListAdapter == null) {
notificationListAdapter = new NotificationListAdapter(notifications, MainActivity.this);
((RecyclerView) findViewById(R.id.notifications_list)).setAdapter(notificationListAdapter);
} else {
notificationListAdapter.addNotifications(notifications);
}
resolveCommentAuthors(notificationListAdapter.getAuthorUrls());
notificationListAdapter.setClickListener(new NotificationListAdapter.NotificationClickListener() {
@Override
public void onNotificationClicked(LbryNotification notification) {
// set as seen and read
NotificationUpdateTask task = new NotificationUpdateTask(Arrays.asList(notification.getRemoteId()), true, true, true);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
markNotificationReadAndSeen(notification.getId());
notification.setSeen(true);
if (notificationListAdapter != null) {
notificationListAdapter.notifyDataSetChanged();
}
String targetUrl = notification.getTargetUrl();
if (targetUrl.startsWith(SPECIAL_URL_PREFIX)) {
openSpecialUrl(targetUrl, "notification");
} else {
LbryUri target = LbryUri.tryParse(notification.getTargetUrl());
if (target != null) {
if (target.isChannel()) {
openChannelUrl(notification.getTargetUrl(), "notification");
} else {
openFileUrl(notification.getTargetUrl(), "notification");
}
}
}
hideNotifications();
}
});
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void markNotificationReadAndSeen(long notificationId) {
(new AsyncTask<Void, Void, Void>() {
protected Void doInBackground(Void... params) {
if (dbHelper != null) {
try {
SQLiteDatabase db = dbHelper.getWritableDatabase();
DatabaseHelper.markNotificationReadAndSeen(notificationId, db);
} catch (Exception ex) {
// pass
}
}
return null;
}
protected void onPostExecute() {
loadUnreadNotificationsCount();
}
}).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void resolveCommentAuthors(List<String> urls) {
if (urls != null && urls.size() > 0) {
ResolveTask task = new ResolveTask(urls, Lbry.LBRY_TV_CONNECTION_STRING, null, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
if (notificationListAdapter != null) {
notificationListAdapter.updateAuthorClaims(claims);
}
}
@Override
public void onError(Exception error) {
// pass
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
private void checkSyncedWallet() {
String password = Utils.getSecureValue(SECURE_VALUE_KEY_SAVED_PASSWORD, this, Lbry.KEYSTORE);
// Just check if the current user has a synced wallet, no need to do anything else here
@@ -3073,6 +3493,53 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
return (ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED);
}
private void establishBillingClientConnection() {
if (billingClient != null) {
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
// no need to do anything here. purchases are always checked server-side
checkPurchases();
}
}
@Override
public void onBillingServiceDisconnected() {
establishBillingClientConnection();
}
});
}
}
public static void handleBillingPurchase(
Purchase purchase,
BillingClient billingClient,
Context context,
View progressView,
RewardVerifiedHandler handler) {
String sku = purchase.getSku();
if (SKU_SKIP.equalsIgnoreCase(sku)) {
// send purchase token for verification
if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED
/*&& isSignatureValid(purchase)*/) {
// consume the purchase
String purchaseToken = purchase.getPurchaseToken();
ConsumeParams consumeParams = ConsumeParams.newBuilder().setPurchaseToken(purchaseToken).build();
billingClient.consumeAsync(consumeParams, new ConsumeResponseListener() {
@Override
public void onConsumeResponse(@NonNull BillingResult billingResult, @NonNull String s) {
}
});
// send the purchase token to the backend to complete verification
AndroidPurchaseTask task = new AndroidPurchaseTask(purchaseToken, progressView, context, handler);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
}
public interface BackPressInterceptor {
boolean onBackPressed();
}
@@ -7,19 +7,35 @@ import android.content.IntentFilter;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.widget.ViewPager2;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingClientStateListener;
import com.android.billingclient.api.BillingFlowParams;
import com.android.billingclient.api.BillingResult;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.PurchasesUpdatedListener;
import com.android.billingclient.api.SkuDetails;
import com.android.billingclient.api.SkuDetailsParams;
import com.android.billingclient.api.SkuDetailsResponseListener;
import com.google.android.material.snackbar.Snackbar;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import io.lbry.browser.adapter.VerificationPagerAdapter;
import io.lbry.browser.listener.SignInListener;
import io.lbry.browser.listener.WalletSyncListener;
import io.lbry.browser.model.lbryinc.RewardVerified;
import io.lbry.browser.model.lbryinc.User;
import io.lbry.browser.tasks.RewardVerifiedHandler;
import io.lbry.browser.tasks.lbryinc.FetchCurrentUserTask;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryAnalytics;
@@ -32,11 +48,59 @@ public class VerificationActivity extends FragmentActivity implements SignInList
public static final int VERIFICATION_FLOW_REWARDS = 2;
public static final int VERIFICATION_FLOW_WALLET = 3;
private BillingClient billingClient;
private BroadcastReceiver sdkReceiver;
private String email;
private boolean signedIn;
private int flow;
private PurchasesUpdatedListener purchasesUpdatedListener = new PurchasesUpdatedListener() {
@Override
public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List<Purchase> purchases) {
int responseCode = billingResult.getResponseCode();
if (responseCode == BillingClient.BillingResponseCode.OK && purchases != null)
{
for (Purchase purchase : purchases) {
if (MainActivity.SKU_SKIP.equalsIgnoreCase(purchase.getSku())) {
showLoading();
MainActivity.handleBillingPurchase(
purchase,
billingClient,
VerificationActivity.this, null, new RewardVerifiedHandler() {
@Override
public void onSuccess(RewardVerified rewardVerified) {
if (Lbryio.currentUser != null) {
Lbryio.currentUser.setRewardApproved(rewardVerified.isRewardApproved());
}
if (!rewardVerified.isRewardApproved()) {
// show pending purchase message (possible slow card tx)
Snackbar.make(findViewById(R.id.verification_pager), R.string.purchase_request_pending, Snackbar.LENGTH_LONG).show();
} else {
Snackbar.make(findViewById(R.id.verification_pager), R.string.reward_verification_successful, Snackbar.LENGTH_LONG).show();
}
setResult(RESULT_OK);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
finish();
}
}, 3000);
}
@Override
public void onError(Exception error) {
showFetchUserError(getString(R.string.purchase_request_failed_error));
hideLoading();
}
});
}
}
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -73,6 +137,12 @@ public class VerificationActivity extends FragmentActivity implements SignInList
};
registerReceiver(sdkReceiver, filter);
billingClient = BillingClient.newBuilder(this)
.setListener(purchasesUpdatedListener)
.enablePendingPurchases()
.build();
establishBillingClientConnection();
setContentView(R.layout.activity_verification);
ViewPager2 viewPager = findViewById(R.id.verification_pager);
viewPager.setUserInputEnabled(false);
@@ -89,6 +159,24 @@ public class VerificationActivity extends FragmentActivity implements SignInList
});
}
private void establishBillingClientConnection() {
if (billingClient != null) {
billingClient.startConnection(new BillingClientStateListener() {
@Override
public void onBillingSetupFinished(@NonNull BillingResult billingResult) {
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
// no need to do anything here. purchases are always checked server-side
}
}
@Override
public void onBillingServiceDisconnected() {
establishBillingClientConnection();
}
});
}
}
public void onResume() {
super.onResume();
LbryAnalytics.setCurrentScreen(this, "Verification", "Verification");
@@ -104,11 +192,13 @@ public class VerificationActivity extends FragmentActivity implements SignInList
flowHandled = true;
} else if (flow == VERIFICATION_FLOW_REWARDS) {
User user = Lbryio.currentUser;
if (!user.isIdentityVerified()) {
// disable phone verification for now
/*if (!user.isIdentityVerified()) {
// phone number verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_PHONE, false);
flowHandled = true;
} else if (!user.isRewardApproved()) {
} else */
if (!user.isRewardApproved()) {
// manual verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_MANUAL, false);
flowHandled = true;
@@ -195,10 +285,14 @@ public class VerificationActivity extends FragmentActivity implements SignInList
ViewPager2 viewPager = findViewById(R.id.verification_pager);
// for rewards, (show phone verification if not done, or manual verification if required)
if (flow == VERIFICATION_FLOW_REWARDS) {
if (!user.isIdentityVerified()) {
// skipping phone verification
/*if (!user.isIdentityVerified()) {
// phone number verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_PHONE, false);
} else if (!user.isRewardApproved()) {
} else
*/
if (!user.isRewardApproved()) {
// manual verification required
viewPager.setCurrentItem(VerificationPagerAdapter.PAGE_VERIFICATION_MANUAL, false);
} else {
@@ -289,6 +383,54 @@ public class VerificationActivity extends FragmentActivity implements SignInList
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
}
@Override
public void onSkipQueueAction() {
if (billingClient != null) {
List<String> skuList = new ArrayList<>();
skuList.add(MainActivity.SKU_SKIP);
SkuDetailsParams detailsParams = SkuDetailsParams.newBuilder().
setType(BillingClient.SkuType.INAPP).
setSkusList(skuList).build();
billingClient.querySkuDetailsAsync(detailsParams, new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(@NonNull BillingResult billingResult, @Nullable List<SkuDetails> list) {
if (list != null && list.size() > 0) {
// we only queried one product, so it should be the first item in the list
SkuDetails skuDetails = list.get(0);
// launch the billing flow for skip queue
BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder().
setSkuDetails(skuDetails).build();
billingClient.launchBillingFlow(VerificationActivity.this, billingFlowParams);
}
}
});
}
}
@Override
public void onTwitterVerified() {
Snackbar.make(findViewById(R.id.verification_pager), R.string.reward_verification_successful, Snackbar.LENGTH_LONG).show();
setResult(RESULT_OK);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
finish();
}
}, 3000);
}
@Override
public void onManualProgress(boolean progress) {
if (progress) {
findViewById(R.id.verification_close_button).setVisibility(View.GONE);
} else {
findViewById(R.id.verification_close_button).setVisibility(View.VISIBLE);
}
}
@Override
public void onDestroy() {
Helper.unregisterReceiver(sdkReceiver, this);
@@ -193,6 +193,10 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
protected TextView fileSizeView;
protected ProgressBar downloadProgressView;
protected TextView deviceView;
protected View loadingImagePlaceholder;
protected View loadingTextPlaceholder1;
protected View loadingTextPlaceholder2;
public ViewHolder(View v) {
super(v);
feeContainer = v.findViewById(R.id.claim_fee_container);
@@ -212,6 +216,10 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
fileSizeView = v.findViewById(R.id.claim_file_size);
downloadProgressView = v.findViewById(R.id.claim_download_progress);
deviceView = v.findViewById(R.id.claim_view_device);
loadingImagePlaceholder = v.findViewById(R.id.claim_thumbnail_placeholder);
loadingTextPlaceholder1 = v.findViewById(R.id.claim_text_loading_placeholder_1);
loadingTextPlaceholder2 = v.findViewById(R.id.claim_text_loading_placeholder_2);
}
}
@@ -315,7 +323,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
int paddingBottom = position == getItemCount() - 1 ? 16 : 8;
int paddingTopScaled = Helper.getScaledValue(paddingTop, scale);
int paddingBottomScaled = Helper.getScaledValue(paddingBottom, scale);
vh.itemView.setPadding(vh.itemView.getPaddingLeft(), paddingTopScaled, vh.itemView.getPaddingRight(), paddingBottomScaled);
vh.itemView.setPadding(vh.itemView.getPaddingStart(), paddingTopScaled, vh.itemView.getPaddingEnd(), paddingBottomScaled);
Claim original = items.get(position);
boolean isRepost = Claim.TYPE_REPOST.equalsIgnoreCase(original.getValueType());
@@ -394,7 +402,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
});
vh.publishTimeView.setVisibility(!isPending ? View.VISIBLE : View.GONE);
vh.pendingTextView.setVisibility(isPending ? View.VISIBLE : View.GONE);
vh.pendingTextView.setVisibility(isPending && !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
vh.repostInfoView.setVisibility(isRepost && type != VIEW_TYPE_FEATURED ? View.VISIBLE : View.GONE);
vh.repostChannelView.setText(isRepost ? original.getSigningChannel().getName() : null);
vh.repostChannelView.setOnClickListener(new View.OnClickListener() {
@@ -417,6 +425,13 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
vh.noThumbnailView.setVisibility(Helper.isNullOrEmpty(thumbnailUrl) ? View.VISIBLE : View.GONE);
Helper.setIconViewBackgroundColor(vh.noThumbnailView, bgColor, false, context);
Helper.setViewVisibility(vh.loadingImagePlaceholder, item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.loadingTextPlaceholder1, item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.loadingTextPlaceholder2, item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.titleView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.publisherView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
Helper.setViewVisibility(vh.publishTimeView, !item.isLoadingPlaceholder() ? View.VISIBLE : View.GONE);
if (type == VIEW_TYPE_FEATURED && item.isUnresolved()) {
vh.durationView.setVisibility(View.GONE);
vh.titleView.setText("Nothing here. Publish something!");
@@ -61,6 +61,16 @@ public class CommentListAdapter extends RecyclerView.Adapter<CommentListAdapter.
notifyDataSetChanged();
}
public int getPositionForComment(String commentHash) {
for (int i = 0; i < items.size(); i++) {
if (commentHash.equalsIgnoreCase(items.get(i).getId())) {
return i;
}
}
return -1;
}
@Override
public int getItemCount() {
return items != null ? items.size() : 0;
@@ -163,9 +173,9 @@ public class CommentListAdapter extends RecyclerView.Adapter<CommentListAdapter.
public void onBindViewHolder(ViewHolder holder, int position) {
Comment comment = items.get(position);
holder.itemView.setPadding(
nested ? Helper.getScaledValue(56, scale) : holder.itemView.getPaddingLeft(),
nested ? Helper.getScaledValue(56, scale) : holder.itemView.getPaddingStart(),
holder.itemView.getPaddingTop(),
nested ? 0 : holder.itemView.getPaddingRight(),
nested ? 0 : holder.itemView.getPaddingEnd(),
holder.itemView.getPaddingBottom());
holder.channelName.setText(comment.getChannelName());
@@ -0,0 +1,205 @@
package io.lbry.browser.adapter;
import android.content.Context;
import android.graphics.Color;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import io.lbry.browser.R;
import io.lbry.browser.model.Claim;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.ui.controls.SolidIconView;
import io.lbry.browser.utils.Helper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Data
@EqualsAndHashCode(callSuper = false)
public class NotificationListAdapter extends RecyclerView.Adapter<NotificationListAdapter.ViewHolder> {
private static final String RULE_CREATOR_SUBSCRIBER = "creator_subscriber";
private static final String RULE_COMMENT = "comment";
private Context context;
private List<LbryNotification> items;
@Setter
private NotificationClickListener clickListener;
@Getter
@Setter
private int customizeMode;
public NotificationListAdapter(List<LbryNotification> notifications, Context context) {
this.context = context;
this.items = new ArrayList<>(notifications);
Collections.sort(items, Collections.reverseOrder(new LbryNotification()));
}
public static class ViewHolder extends RecyclerView.ViewHolder {
protected View layoutView;
protected TextView titleView;
protected TextView bodyView;
protected TextView timeView;
protected SolidIconView iconView;
protected ImageView thumbnailView;
public ViewHolder(View v) {
super(v);
layoutView = v.findViewById(R.id.notification_layout);
titleView = v.findViewById(R.id.notification_title);
bodyView = v.findViewById(R.id.notification_body);
timeView = v.findViewById(R.id.notification_time);
iconView = v.findViewById(R.id.notification_icon);
thumbnailView = v.findViewById(R.id.notification_author_thumbnail);
}
}
public int getItemCount() {
return items != null ? items.size() : 0;
}
public void insertNotification(LbryNotification notification, int index) {
if (!items.contains(notification)) {
items.add(index, notification);
}
notifyDataSetChanged();
}
public void addNotification(LbryNotification notification) {
if (!items.contains(notification)) {
items.add(notification);
}
notifyDataSetChanged();
}
public List<String> getAuthorUrls() {
List<String> urls = new ArrayList<>();
for (LbryNotification item : items) {
if (!Helper.isNullOrEmpty(item.getAuthorUrl())) {
urls.add(item.getAuthorUrl());
}
}
return urls;
}
public void updateAuthorClaims(List<Claim> claims) {
for (Claim claim : claims) {
if (claim != null && claim.getThumbnailUrl() != null) {
updateClaimForAuthorUrl(claim);
}
}
notifyDataSetChanged();
}
private void updateClaimForAuthorUrl(Claim claim) {
for (LbryNotification item : items) {
if (claim.getPermanentUrl().equalsIgnoreCase(item.getAuthorUrl())) {
item.setCommentAuthor(claim);
}
}
}
public void addNotifications(List<LbryNotification> notifications) {
for (LbryNotification notification : notifications) {
if (!items.contains(notification)) {
items.add(notification);
}
}
Collections.sort(items, Collections.reverseOrder(new LbryNotification()));
notifyDataSetChanged();
}
@Override
public NotificationListAdapter.ViewHolder onCreateViewHolder(ViewGroup root, int viewType) {
View v = LayoutInflater.from(context).inflate(R.layout.list_item_notification, root, false);
return new NotificationListAdapter.ViewHolder(v);
}
private int getStringIdForRule(String rule) {
if (RULE_CREATOR_SUBSCRIBER.equalsIgnoreCase(rule)) {
return R.string.fa_heart;
}
if (RULE_COMMENT.equalsIgnoreCase(rule)) {
return R.string.fa_comment_alt;
}
return R.string.fa_asterisk;
}
private int getColorForRule(String rule) {
if (RULE_CREATOR_SUBSCRIBER.equalsIgnoreCase(rule)) {
return Color.RED;
}
if (RULE_COMMENT.equalsIgnoreCase(rule)) {
return ContextCompat.getColor(context, R.color.nextLbryGreen);
}
return ContextCompat.getColor(context, R.color.lbryGreen);
}
@Override
public void onBindViewHolder(NotificationListAdapter.ViewHolder vh, int position) {
LbryNotification notification = items.get(position);
vh.layoutView.setBackgroundColor(ContextCompat.getColor(context, notification.isSeen() ? android.R.color.transparent : R.color.nextLbryGreenSemiTransparent));
vh.titleView.setVisibility(!Helper.isNullOrEmpty(notification.getTitle()) ? View.VISIBLE : View.GONE);
vh.titleView.setText(notification.getTitle());
vh.bodyView.setText(notification.getDescription());
vh.timeView.setText(DateUtils.getRelativeTimeSpanString(
getLocalNotificationTime(notification), System.currentTimeMillis(), 0, DateUtils.FORMAT_ABBREV_RELATIVE));
vh.thumbnailView.setVisibility(notification.getCommentAuthor() == null ? View.INVISIBLE : View.VISIBLE);
if (notification.getCommentAuthor() != null) {
Glide.with(context.getApplicationContext()).load(
notification.getCommentAuthor().getThumbnailUrl()).apply(RequestOptions.circleCropTransform()).into(vh.thumbnailView);
}
vh.iconView.setVisibility(notification.getCommentAuthor() != null ? View.INVISIBLE : View.VISIBLE);
vh.iconView.setText(getStringIdForRule(notification.getRule()));
vh.iconView.setTextColor(getColorForRule(notification.getRule()));
vh.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (clickListener != null) {
clickListener.onNotificationClicked(notification);
}
}
});
}
private long getLocalNotificationTime(LbryNotification notification) {
TimeZone utcTZ = TimeZone.getTimeZone("UTC");
TimeZone targetTZ = TimeZone.getDefault();
Calendar cal = new GregorianCalendar(utcTZ);
cal.setTimeInMillis(notification.getTimestamp().getTime());
cal.add(Calendar.MILLISECOND, utcTZ.getRawOffset() * -1);
cal.add(Calendar.MILLISECOND, targetTZ.getRawOffset());
return cal.getTimeInMillis();
}
public interface NotificationClickListener {
void onNotificationClicked(LbryNotification notification);
}
}
@@ -4,7 +4,6 @@ import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.opengl.Visibility;
import java.math.BigDecimal;
import java.text.ParseException;
@@ -13,16 +12,16 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import io.lbry.browser.exceptions.LbryUriException;
import io.lbry.browser.model.Tag;
import io.lbry.browser.model.UrlSuggestion;
import io.lbry.browser.model.ViewHistory;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.model.lbryinc.Subscription;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.LbryUri;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final int DATABASE_VERSION = 2;
public static final int DATABASE_VERSION = 6;
public static final String DATABASE_NAME = "LbryApp.db";
private static DatabaseHelper instance;
@@ -48,7 +47,19 @@ public class DatabaseHelper extends SQLiteOpenHelper {
", thumbnail_url TEXT" +
", release_time INTEGER " +
", device TEXT" +
", timestamp TEXT NOT NULL)"
", timestamp TEXT NOT NULL)",
"CREATE TABLE notifications (" +
" id INTEGER PRIMARY KEY NOT NULL" +
", remote_id INTEGER NOT NULL" +
", author_url TEXT" +
", title TEXT" +
", description TEXT" +
", thumbnail_url TEXT" +
", target_url TEXT" +
", rule TEXT" +
", is_read INTEGER DEFAULT 0 NOT NULL" +
", is_seen INTEGER DEFAULT 0 NOT NULL " +
", timestamp TEXT NOT NULL)",
};
private static final String[] SQL_CREATE_INDEXES = {
"CREATE UNIQUE INDEX idx_subscription_url ON subscriptions (url)",
@@ -56,13 +67,39 @@ public class DatabaseHelper extends SQLiteOpenHelper {
"CREATE UNIQUE INDEX idx_url_history_url ON url_history (url)",
"CREATE UNIQUE INDEX idx_tag_name ON tags (name)",
"CREATE UNIQUE INDEX idx_view_history_url_device ON view_history (url, device)",
"CREATE INDEX idx_view_history_device ON view_history (device)"
"CREATE INDEX idx_view_history_device ON view_history (device)",
"CREATE UNIQUE INDEX idx_notification_remote_id ON notifications (remote_id)",
"CREATE INDEX idx_notification_timestamp ON notifications (timestamp)"
};
private static final String[] SQL_V1_V2_UPGRADE = {
"ALTER TABLE view_history ADD COLUMN currency TEXT"
};
private static final String[] SQL_V2_V3_UPGRADE = {
"CREATE TABLE notifications (" +
" id INTEGER PRIMARY KEY NOT NULL" +
", title TEXT" +
", description TEXT" +
", thumbnail_url TEXT" +
", target_url TEXT" +
", is_read INTEGER DEFAULT 0 NOT NULL" +
", timestamp TEXT NOT NULL)",
"CREATE INDEX idx_notification_timestamp ON notifications (timestamp)"
};
private static final String[] SQL_V3_V4_UPGRADE = {
"ALTER TABLE notifications ADD COLUMN remote_id INTEGER",
"CREATE UNIQUE INDEX idx_notification_remote_id ON notifications (remote_id)"
};
private static final String[] SQL_V4_V5_UPGRADE = {
"ALTER TABLE notifications ADD COLUMN rule TEXT",
"ALTER TABLE notifications ADD COLUMN is_seen TEXT"
};
private static final String[] SQL_V5_V6_UPGRADE = {
"ALTER TABLE notifications ADD COLUMN author_url TEXT"
};
private static final String SQL_INSERT_SUBSCRIPTION = "REPLACE INTO subscriptions (channel_name, url) VALUES (?, ?)";
private static final String SQL_CLEAR_SUBSCRIPTIONS = "DELETE FROM subscriptions";
private static final String SQL_DELETE_SUBSCRIPTION = "DELETE FROM subscriptions WHERE url = ?";
@@ -73,6 +110,12 @@ public class DatabaseHelper extends SQLiteOpenHelper {
private static final String SQL_CLEAR_URL_HISTORY_BEFORE_TIME = "DELETE FROM url_history WHERE timestamp < ?";
private static final String SQL_GET_RECENT_URL_HISTORY = "SELECT value, url, type FROM url_history ORDER BY timestamp DESC LIMIT 10";
private static final String SQL_INSERT_NOTIFICATION = "REPLACE INTO notifications (remote_id, author_url, title, description, rule, target_url, is_read, is_seen, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String SQL_GET_NOTIFICATIONS = "SELECT id, remote_id, author_url, title, description, rule, target_url, is_read, is_seen, timestamp FROM notifications ORDER BY timestamp DESC LIMIT 500";
private static final String SQL_GET_UNREAD_NOTIFICATIONS_COUNT = "SELECT COUNT(id) FROM notifications WHERE is_read <> 1";
private static final String SQL_MARK_NOTIFICATIONS_READ = "UPDATE notifications SET is_read = 1 WHERE is_read = 0";
private static final String SQL_MARK_NOTIFICATION_READ_AND_SEEN = "UPDATE notifications SET is_read = 1, is_seen = 1 WHERE id = ?";
private static final String SQL_INSERT_VIEW_HISTORY =
"REPLACE INTO view_history (url, claim_id, claim_name, cost, currency, title, publisher_claim_id, publisher_name, publisher_title, thumbnail_url, device, release_time, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String SQL_GET_VIEW_HISTORY =
@@ -111,6 +154,26 @@ public class DatabaseHelper extends SQLiteOpenHelper {
db.execSQL(sql);
}
}
if (oldVersion < 3) {
for (String sql : SQL_V2_V3_UPGRADE) {
db.execSQL(sql);
}
}
if (oldVersion < 4) {
for (String sql : SQL_V3_V4_UPGRADE) {
db.execSQL(sql);
}
}
if (oldVersion < 5) {
for (String sql : SQL_V4_V5_UPGRADE) {
db.execSQL(sql);
}
}
if (oldVersion < 6) {
for (String sql : SQL_V5_V6_UPGRADE) {
db.execSQL(sql);
}
}
}
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
@@ -251,4 +314,66 @@ public class DatabaseHelper extends SQLiteOpenHelper {
return subscriptions;
}
public static void createOrUpdateNotification(LbryNotification notification, SQLiteDatabase db) {
db.execSQL(SQL_INSERT_NOTIFICATION, new Object[] {
notification.getRemoteId(),
notification.getAuthorUrl(),
notification.getTitle(),
notification.getDescription(),
notification.getRule(),
notification.getTargetUrl(),
notification.isRead() ? 1 : 0,
notification.isSeen() ? 1 : 0,
new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).format(notification.getTimestamp() != null ? notification.getTimestamp() : new Date())
});
}
public static List<LbryNotification> getNotifications(SQLiteDatabase db) {
List<LbryNotification> notifications = new ArrayList<>();
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_NOTIFICATIONS, null);
while (cursor.moveToNext()) {
LbryNotification notification = new LbryNotification();
int columnIndex = 0;
notification.setId(cursor.getLong(columnIndex++));
notification.setRemoteId(cursor.getLong(columnIndex++));
notification.setAuthorUrl(cursor.getString(columnIndex++));
notification.setTitle(cursor.getString(columnIndex++));
notification.setDescription(cursor.getString(columnIndex++));
notification.setRule(cursor.getString(columnIndex++));
notification.setTargetUrl(cursor.getString(columnIndex++));
notification.setRead(cursor.getInt(columnIndex++) == 1);
notification.setSeen(cursor.getInt(columnIndex++) == 1);
try {
notification.setTimestamp(new SimpleDateFormat(Helper.ISO_DATE_FORMAT_PATTERN).parse(cursor.getString(columnIndex++)));
} catch (ParseException ex) {
// invalid timestamp (which shouldn't happen). Skip this item
continue;
}
notifications.add(notification);
}
} finally {
Helper.closeCursor(cursor);
}
return notifications;
}
public static int getUnreadNotificationsCount(SQLiteDatabase db) {
int count = 0;
Cursor cursor = null;
try {
cursor = db.rawQuery(SQL_GET_UNREAD_NOTIFICATIONS_COUNT, null);
if (cursor.moveToNext()) {
count = cursor.getInt(0);
}
} finally {
Helper.closeCursor(cursor);
}
return count;
}
public static void markNotificationsRead(SQLiteDatabase db) {
db.execSQL(SQL_MARK_NOTIFICATIONS_READ);
}
public static void markNotificationReadAndSeen(long notificationId, SQLiteDatabase db) {
db.execSQL(SQL_MARK_NOTIFICATION_READ_AND_SEEN, new Object[] { notificationId });
}
}
@@ -7,4 +7,7 @@ public interface SignInListener {
void onPhoneAdded(String countryCode, String phoneNumber);
void onPhoneVerified();
void onManualVerifyContinue();
void onSkipQueueAction();
void onTwitterVerified();
void onManualProgress(boolean progress);
}
@@ -54,6 +54,7 @@ public class Claim {
@EqualsAndHashCode.Include
private boolean placeholder;
private boolean placeholderAnonymous;
private boolean loadingPlaceholder;
private boolean featured;
private boolean unresolved; // used for featured
private String address;
@@ -0,0 +1,9 @@
package io.lbry.browser.model;
import lombok.Data;
@Data
public class TwitterOauth {
private String oauthToken;
private String oauthTokenSecret;
}
@@ -0,0 +1,40 @@
package io.lbry.browser.model.lbryinc;
import java.util.Comparator;
import java.util.Date;
import io.lbry.browser.model.Claim;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true)
public class LbryNotification implements Comparator<LbryNotification> {
private long id;
@EqualsAndHashCode.Include
private long remoteId;
private String title;
private String description;
private String thumbnailUrl;
private String rule;
private String targetUrl;
private boolean read;
private boolean seen;
private Date timestamp;
// only for comment notifications
private String authorUrl;
private Claim commentAuthor;
public int compare(LbryNotification a, LbryNotification b) {
long t1 = a.getTimestamp() != null ? a.getTimestamp().getTime() : 0;
long t2 = b.getTimestamp() != null ? b.getTimestamp().getTime() : 0;
if (t1 < t2) {
return -1;
}
if (t1 > t2) {
return 1;
}
return 0;
}
}
@@ -0,0 +1,9 @@
package io.lbry.browser.model.lbryinc;
import lombok.Data;
@Data
public class RewardVerified {
private long userId;
private boolean isRewardApproved;
}
@@ -45,10 +45,12 @@ public class CommentListTask extends AsyncTask<Void, Void, List<Comment>> {
options.put("claim_id", claim);
options.put("page", page);
options.put("page_size", pageSize);
options.put("hidden", false);
options.put("include_replies", false);
options.put("is_channel_signature_valid", true);
options.put("skip_validation", true);
options.put("visible", true);
options.put("hidden", false);
JSONObject result = (JSONObject) Lbry.genericApiCall(Lbry.METHOD_COMMENT_LIST, options);
JSONArray items = result.getJSONArray("items");
@@ -0,0 +1,8 @@
package io.lbry.browser.tasks;
import io.lbry.browser.model.lbryinc.RewardVerified;
public interface RewardVerifiedHandler {
void onSuccess(RewardVerified rewardVerified);
void onError(Exception error);
}
@@ -0,0 +1,8 @@
package io.lbry.browser.tasks;
import io.lbry.browser.model.TwitterOauth;
public interface TwitterOauthHandler {
void onSuccess(TwitterOauth twitterOauth);
void onError(Exception error);
}
@@ -0,0 +1,68 @@
package io.lbry.browser.tasks.lbryinc;
import android.content.Context;
import android.os.AsyncTask;
import android.view.View;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import io.lbry.browser.MainActivity;
import io.lbry.browser.model.lbryinc.RewardVerified;
import io.lbry.browser.tasks.RewardVerifiedHandler;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
import okhttp3.Response;
public class AndroidPurchaseTask extends AsyncTask<Void, Void, RewardVerified> {
private Context context;
private View progressView;
private String purchaseToken;
private RewardVerifiedHandler handler;
private Exception error;
public AndroidPurchaseTask(String purchaseToken, View progressView, Context context, RewardVerifiedHandler handler) {
this.purchaseToken = purchaseToken;
this.progressView = progressView;
this.context = context;
this.handler = handler;
}
protected void onPreExecute() {
Helper.setViewVisibility(progressView, View.VISIBLE);
}
protected RewardVerified doInBackground(Void... params) {
try {
Map<String, String> options = new HashMap<>();
options.put("purchase_token", purchaseToken);
JSONObject object = (JSONObject) Lbryio.parseResponse(Lbryio.call("verification", "android_purchase", options, context));
Type type = new TypeToken<RewardVerified>(){}.getType();
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
return gson.fromJson(object.toString(), type);
} catch (Exception ex) {
error = ex;
return null;
}
}
protected void onPostExecute(RewardVerified result) {
Helper.setViewVisibility(progressView, View.GONE);
if (handler != null) {
if (result != null) {
handler.onSuccess(result);
} else {
handler.onError(error);
}
}
}
}
@@ -0,0 +1,128 @@
package io.lbry.browser.tasks.lbryinc;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import io.lbry.browser.MainActivity;
import io.lbry.browser.data.DatabaseHelper;
import io.lbry.browser.exceptions.LbryioRequestException;
import io.lbry.browser.exceptions.LbryioResponseException;
import io.lbry.browser.model.lbryinc.LbryNotification;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
public class NotificationListTask extends AsyncTask<Void, Void, List<LbryNotification>> {
private static final String TAG = "Notifications";
private Context context;
private ListNotificationsHandler handler;
private ProgressBar progressBar;
private Exception error;
public NotificationListTask(Context context, ProgressBar progressBar, ListNotificationsHandler handler) {
this.context = context;
this.progressBar = progressBar;
this.handler = handler;
}
protected void onPreExecute() {
Helper.setViewVisibility(progressBar, View.VISIBLE);
}
protected List<LbryNotification> doInBackground(Void... params) {
List<LbryNotification> notifications = new ArrayList<>();
SQLiteDatabase db = null;
try {
JSONArray array = (JSONArray) Lbryio.parseResponse(Lbryio.call("notification", "list", context));
if (array != null) {
for (int i = 0; i < array.length(); i++) {
JSONObject item = array.getJSONObject(i);
if (item.has("notification_parameters")) {
LbryNotification notification = new LbryNotification();
JSONObject notificationParams = item.getJSONObject("notification_parameters");
if (notificationParams.has("device")) {
JSONObject device = notificationParams.getJSONObject("device");
notification.setTitle(Helper.getJSONString("title", null, device));
notification.setDescription(Helper.getJSONString("text", null, device));
notification.setTargetUrl(Helper.getJSONString("target", null, device));
}
if (notificationParams.has("dynamic") && !notificationParams.isNull("dynamic")) {
JSONObject dynamic = notificationParams.getJSONObject("dynamic");
if (dynamic.has("comment_author")) {
notification.setAuthorUrl(Helper.getJSONString("comment_author", null, dynamic));
}
if (dynamic.has("channelURI")) {
String channelUrl = Helper.getJSONString("channelURI", null, dynamic);
if (!Helper.isNullOrEmpty(channelUrl)) {
notification.setTargetUrl(channelUrl);
}
}
if (dynamic.has("hash") && "comment".equalsIgnoreCase(Helper.getJSONString("notification_rule", null, item))) {
notification.setTargetUrl(String.format("%s?comment_hash=%s", notification.getTargetUrl(), dynamic.getString("hash")));
}
}
notification.setRule(Helper.getJSONString("notification_rule", null, item));
notification.setRemoteId(Helper.getJSONLong("id", 0, item));
notification.setRead(Helper.getJSONBoolean("is_read", false, item));
notification.setSeen(Helper.getJSONBoolean("is_seen", false, item));
try {
SimpleDateFormat dateFormat = new SimpleDateFormat(Helper.ISO_DATE_FORMAT_JSON, Locale.US);
notification.setTimestamp(dateFormat.parse(Helper.getJSONString("created_at", dateFormat.format(new Date()), item)));
} catch (ParseException ex) {
notification.setTimestamp(new Date());
}
if (notification.getRemoteId() > 0 && !Helper.isNullOrEmpty(notification.getDescription())) {
notifications.add(notification);
}
}
}
if (context instanceof MainActivity) {
db = ((MainActivity) context).getDbHelper().getWritableDatabase();
for (LbryNotification notification : notifications) {
DatabaseHelper.createOrUpdateNotification(notification, db);
}
}
}
} catch (ClassCastException | LbryioRequestException | LbryioResponseException | JSONException | SQLiteException | IllegalStateException ex) {
Log.e(TAG, ex.getMessage(), ex);
error = ex;
return null;
}
return notifications;
}
protected void onPostExecute(List<LbryNotification> notifications) {
Helper.setViewVisibility(progressBar, View.GONE);
if (handler != null) {
if (notifications != null) {
handler.onSuccess(notifications);
} else {
handler.onError(error);
}
}
}
public interface ListNotificationsHandler {
void onSuccess(List<LbryNotification> notifications);
void onError(Exception exception);
}
}
@@ -0,0 +1,47 @@
package io.lbry.browser.tasks.lbryinc;
import android.os.AsyncTask;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.lbry.browser.exceptions.LbryioRequestException;
import io.lbry.browser.exceptions.LbryioResponseException;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
public class NotificationUpdateTask extends AsyncTask<Void, Void, Boolean> {
private List<Long> ids;
private boolean seen;
private boolean read;
private boolean updateSeen;
public NotificationUpdateTask(List<Long> ids, boolean read) {
this(ids, read, false, false);
}
public NotificationUpdateTask(List<Long> ids, boolean read, boolean seen, boolean updateSeen) {
this.ids = ids;
this.read = read;
this.seen = seen;
this.updateSeen = updateSeen;
}
protected Boolean doInBackground(Void... params) {
Map<String, String> options = new HashMap<>();
options.put("notification_ids", Helper.joinL(ids, ","));
options.put("is_read", String.valueOf(read));
if (updateSeen) {
options.put("is_seen", String.valueOf(seen));
}
try {
Object result = Lbryio.parseResponse(Lbryio.call("notification", "edit", options, null));
return "ok".equalsIgnoreCase(result.toString());
} catch (LbryioResponseException | LbryioRequestException ex) {
}
return false;
}
}
@@ -0,0 +1,68 @@
package io.lbry.browser.tasks.lbryinc;
import android.content.Context;
import android.os.AsyncTask;
import android.view.View;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.json.JSONObject;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import io.lbry.browser.model.TwitterOauth;
import io.lbry.browser.model.lbryinc.RewardVerified;
import io.lbry.browser.tasks.RewardVerifiedHandler;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
public class TwitterVerifyTask extends AsyncTask<Void, Void, RewardVerified> {
private Context context;
private View progressView;
private TwitterOauth twitterOauth;
private RewardVerifiedHandler handler;
private Exception error;
public TwitterVerifyTask(TwitterOauth twitterOauth, View progressView, Context context, RewardVerifiedHandler handler) {
this.twitterOauth = twitterOauth;
this.progressView = progressView;
this.context = context;
this.handler = handler;
}
protected void onPreExecute() {
Helper.setViewVisibility(progressView, View.VISIBLE);
}
protected RewardVerified doInBackground(Void... params) {
try {
Map<String, String> options = new HashMap<>();
options.put("oauth_token", twitterOauth.getOauthToken());
options.put("oauth_token_secret", twitterOauth.getOauthTokenSecret());
JSONObject object = (JSONObject) Lbryio.parseResponse(Lbryio.call("verification", "twitter_verify", options, context));
Type type = new TypeToken<RewardVerified>(){}.getType();
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
return gson.fromJson(object.toString(), type);
} catch (Exception ex) {
error = ex;
return null;
}
}
protected void onPostExecute(RewardVerified result) {
Helper.setViewVisibility(progressView, View.GONE);
if (handler != null) {
if (result != null) {
handler.onSuccess(result);
} else {
handler.onError(error);
}
}
}
}
@@ -0,0 +1,68 @@
package io.lbry.browser.tasks.verification;
import android.os.AsyncTask;
import com.google.api.client.auth.oauth.OAuthHmacSigner;
import com.google.api.client.auth.oauth.OAuthParameters;
import com.google.api.client.http.GenericUrl;
import io.lbry.browser.VerificationActivity;
import io.lbry.browser.model.TwitterOauth;
import io.lbry.browser.tasks.TwitterOauthHandler;
import io.lbry.browser.utils.Helper;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class TwitterAccessTokenTask extends AsyncTask<Void, Void, String> {
private static final String ENDPOINT = "https://api.twitter.com/oauth/access_token";
private Exception error;
private String oauthParams;
private TwitterOauthHandler handler;
public TwitterAccessTokenTask(String oauthParams, TwitterOauthHandler handler) {
this.oauthParams = oauthParams;
this.handler = handler;
}
public String doInBackground(Void... params) {
try {
String url = String.format("%s?%s", ENDPOINT, oauthParams);
RequestBody body = RequestBody.create(new byte[0]);
Request request = new Request.Builder().url(url).post(body).build();
OkHttpClient client = new OkHttpClient.Builder().build();
Response response = client.newCall(request).execute();
return response.body().string();
} catch (Exception ex) {
error = ex;
return null;
}
}
protected void onPostExecute(String response) {
if (!Helper.isNullOrEmpty(response)) {
String[] pairs = response.split("&");
TwitterOauth twitterOauth = new TwitterOauth();
for (String pair : pairs) {
String[] parts = pair.split("=");
if (parts.length != 2) {
continue;
}
String key = parts[0];
String value = parts[1];
if ("oauth_token".equalsIgnoreCase(key)) {
twitterOauth.setOauthToken(value);
} else if ("oauth_token_secret".equalsIgnoreCase(key)) {
twitterOauth.setOauthTokenSecret(value);
}
}
handler.onSuccess(twitterOauth);
} else {
handler.onError(error);
}
}
}
@@ -0,0 +1,88 @@
package io.lbry.browser.tasks.verification;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Base64;
import com.google.api.client.auth.oauth.OAuthHmacSigner;
import com.google.api.client.auth.oauth.OAuthParameters;
import com.google.api.client.http.GenericUrl;
import java.nio.charset.StandardCharsets;
import io.lbry.browser.VerificationActivity;
import io.lbry.browser.model.TwitterOauth;
import io.lbry.browser.tasks.TwitterOauthHandler;
import io.lbry.browser.utils.Helper;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class TwitterRequestTokenTask extends AsyncTask<Void, Void, String> {
private static final String ENDPOINT = "https://api.twitter.com/oauth/request_token";
private String consumerKey;
private String consumerSecret;
private Exception error;
private TwitterOauthHandler handler;
public TwitterRequestTokenTask(String consumerKey, String consumerSecret, TwitterOauthHandler handler) {
this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
this.handler = handler;
}
public String doInBackground(Void... params) {
try {
OAuthHmacSigner signer = new OAuthHmacSigner();
signer.clientSharedSecret = new String(
Base64.decode(consumerSecret, Base64.NO_WRAP), StandardCharsets.UTF_8.name());
OAuthParameters oauthParams = new OAuthParameters();
oauthParams.callback = "https://lbry.tv";
oauthParams.consumerKey = new String(
Base64.decode(consumerKey, Base64.NO_WRAP), StandardCharsets.UTF_8.name());;
oauthParams.signatureMethod = "HMAC-SHA-1";
oauthParams.signer = signer;
oauthParams.computeNonce();
oauthParams.computeTimestamp();
oauthParams.computeSignature("POST", new GenericUrl(ENDPOINT));
RequestBody body = RequestBody.create(new byte[0]);
Request request = new Request.Builder().url(ENDPOINT).addHeader(
"Authorization", oauthParams.getAuthorizationHeader()).post(body).build();
OkHttpClient client = new OkHttpClient.Builder().build();
Response response = client.newCall(request).execute();
return response.body().string();
} catch (Exception ex) {
error = ex;
return null;
}
}
protected void onPostExecute(String response) {
if (!Helper.isNullOrEmpty(response)) {
String[] pairs = response.split("&");
TwitterOauth twitterOauth = new TwitterOauth();
for (String pair : pairs) {
String[] parts = pair.split("=");
if (parts.length != 2) {
continue;
}
String key = parts[0];
String value = parts[1];
if ("oauth_token".equalsIgnoreCase(key)) {
twitterOauth.setOauthToken(value);
} else if ("oauth_token_secret".equalsIgnoreCase(key)) {
twitterOauth.setOauthTokenSecret(value);
}
}
handler.onSuccess(twitterOauth);
} else {
handler.onError(error);
}
}
}
@@ -65,6 +65,14 @@ public class BaseFragment extends Fragment {
MainActivity.resumeGlobalPlayer(context);
}
}
if (params != null && params.containsKey("source") && "notification".equalsIgnoreCase(params.get("source").toString())) {
Context context = getContext();
if (context instanceof MainActivity) {
((MainActivity) context).navigateBackToNotifications();
}
}
rewardDriverClickListenerSet = false;
super.onStop();
}
@@ -18,6 +18,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.AppCompatSpinner;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -64,6 +65,8 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
@Setter
private Claim claim;
@Setter
private String commentHash;
private CommentListAdapter commentListAdapter;
private Comment replyToComment;
@@ -156,7 +159,8 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
if (context instanceof MainActivity) {
((MainActivity) context).addWalletBalanceListener(this);
}
checkCommentSdkInitializing();
checkAndLoadComments();
}
public void onStop() {
@@ -180,13 +184,11 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
@Override
public void onSdkReady() {
fetchChannels();
checkAndLoadComments();
}
private void checkAndLoadComments() {
View root = getView();
if (root != null) {
checkCommentSdkInitializing();
RecyclerView commentsList = root.findViewById(R.id.channel_comments_list);
if (commentsList == null || commentsList.getAdapter() == null || commentsList.getAdapter().getItemCount() == 0) {
loadComments();
@@ -198,7 +200,7 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
View root = getView();
ProgressBar relatedLoading = root.findViewById(R.id.channel_comments_progress);
if (claim != null && root != null) {
CommentListTask task = new CommentListTask(1, 500, claim.getClaimId(), relatedLoading, new CommentListHandler() {
CommentListTask task = new CommentListTask(1, 200, claim.getClaimId(), relatedLoading, new CommentListHandler() {
@Override
public void onSuccess(List<Comment> comments, boolean hasReachedEnd) {
Context ctx = getContext();
@@ -228,6 +230,7 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
checkNoComments();
resolveCommentPosters();
scrollToCommentHash();
}
}
@@ -240,6 +243,20 @@ public class ChannelCommentsFragment extends Fragment implements SdkStatusListen
}
}
private void scrollToCommentHash() {
View root = getView();
// check for the position of commentHash if set
if (root != null && !Helper.isNullOrEmpty(commentHash) && commentListAdapter != null && commentListAdapter.getItemCount() > 0) {
RecyclerView commentList = root.findViewById(R.id.channel_comments_list);
int position = commentListAdapter.getPositionForComment(commentHash);
if (position > -1 && commentList.getLayoutManager() != null) {
NestedScrollView scrollView = root.findViewById(R.id.channel_comments_area);
scrollView.requestChildFocus(commentList, commentList);
commentList.getLayoutManager().scrollToPosition(position);
}
}
}
private void resolveCommentPosters() {
if (commentListAdapter != null) {
List<String> urlsToResolve = new ArrayList<>(commentListAdapter.getClaimUrlsToResolve());
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -14,7 +15,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
@@ -62,7 +62,7 @@ import lombok.SneakyThrows;
public class ChannelFragment extends BaseFragment implements FetchChannelsListener {
private Claim claim;
private boolean subscribing;
private String url;
private String currentUrl;
private View layoutResolving;
private View layoutDisplayArea;
@@ -86,6 +86,9 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private View layoutNothingAtLocation;
private View layoutLoadingState;
// if this is set, scroll to the specific comment on load
private String commentHash;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_channel, container, false);
@@ -321,7 +324,7 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private void checkParams() {
boolean updateRequired = false;
Map<String, Object> params = getParams();
String newUrl = null;
if (params != null) {
if (params.containsKey("claim")) {
Claim claim = (Claim) params.get("claim");
@@ -331,21 +334,39 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
}
}
if (params.containsKey("url")) {
String newUrl = params.get("url").toString();
if (claim == null || !newUrl.equalsIgnoreCase(url)) {
this.claim = null;
this.url = newUrl;
updateRequired = true;
LbryUri newLbryUri = LbryUri.tryParse(params.get("url").toString());
if (newLbryUri != null) {
newUrl = newLbryUri.toString();
String qs = newLbryUri.getQueryString();
if (!Helper.isNullOrEmpty(qs)) {
String[] qsPairs = qs.split("&");
for (String pair : qsPairs) {
String[] parts = pair.split("=");
if (parts.length < 2) {
continue;
}
if ("comment_hash".equalsIgnoreCase(parts[0])) {
commentHash = parts[1];
break;
}
}
}
if (claim == null || !newUrl.equalsIgnoreCase(currentUrl)) {
this.claim = null;
this.currentUrl = newUrl;
updateRequired = true;
}
}
}
}
if (updateRequired) {
resetSubCount();
if (!Helper.isNullOrEmpty(url)) {
if (!Helper.isNullOrEmpty(currentUrl)) {
// check if the claim is already cached
ClaimCacheKey key = new ClaimCacheKey();
key.setUrl(url);
key.setUrl(currentUrl);
if (Lbry.claimCache.containsKey(key)) {
claim = Lbry.claimCache.get(key);
} else {
@@ -357,8 +378,8 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
}
}
if (!Helper.isNullOrEmpty(url)) {
Helper.saveUrlHistory(url, claim != null ? claim.getTitle() : null, UrlSuggestion.TYPE_CHANNEL);
if (!Helper.isNullOrEmpty(currentUrl)) {
Helper.saveUrlHistory(currentUrl, claim != null ? claim.getTitle() : null, UrlSuggestion.TYPE_CHANNEL);
}
if (claim != null) {
@@ -369,13 +390,13 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private void resolveUrl() {
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
Helper.setViewVisibility(layoutLoadingState, View.VISIBLE);
ResolveTask task = new ResolveTask(url, Lbry.LBRY_TV_CONNECTION_STRING, layoutResolving, new ClaimListResultHandler() {
ResolveTask task = new ResolveTask(currentUrl, Lbry.LBRY_TV_CONNECTION_STRING, layoutResolving, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
if (claims.size() > 0 && !Helper.isNullOrEmpty(claims.get(0).getClaimId())) {
claim = claims.get(0);
if (!Helper.isNullOrEmpty(url)) {
Helper.saveUrlHistory(url, claim.getTitle(), UrlSuggestion.TYPE_CHANNEL);
if (!Helper.isNullOrEmpty(currentUrl)) {
Helper.saveUrlHistory(currentUrl, claim.getTitle(), UrlSuggestion.TYPE_CHANNEL);
}
renderClaim();
@@ -441,7 +462,16 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
try {
if (tabPager.getAdapter() == null && context instanceof MainActivity) {
tabPager.setAdapter(new ChannelPagerAdapter(claim, (MainActivity) context));
tabPager.setAdapter(new ChannelPagerAdapter(claim, commentHash, (MainActivity) context));
if (!Helper.isNullOrEmpty(commentHash)) {
// set the Comments tab active if a comment hash is set
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
tabPager.setCurrentItem(2);
}
}, 500);
}
}
new TabLayoutMediator(tabLayout, tabPager, new TabLayoutMediator.TabConfigurationStrategy() {
@Override
@@ -491,9 +521,11 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
private static class ChannelPagerAdapter extends FragmentStateAdapter {
private Claim channelClaim;
public ChannelPagerAdapter(Claim channelClaim, FragmentActivity activity) {
private String commentHash;
public ChannelPagerAdapter(Claim channelClaim, String commentHash, FragmentActivity activity) {
super(activity);
this.channelClaim = channelClaim;
this.commentHash = commentHash;
}
@SneakyThrows
@@ -526,6 +558,9 @@ public class ChannelFragment extends BaseFragment implements FetchChannelsListen
if (channelClaim != null) {
commentsFragment.setClaim(channelClaim);
}
if (!Helper.isNullOrEmpty(commentHash)) {
commentsFragment.setCommentHash(commentHash);
}
return commentsFragment;
}
@@ -38,6 +38,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.AppCompatSpinner;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -233,6 +234,9 @@ public class FileViewFragment extends BaseFragment implements
private View inlineChannelCreatorProgress;
private MaterialButton inlineChannelCreatorCreateButton;
// if this is set, scroll to the specific comment on load
private String commentHash;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_file_view, container, false);
@@ -294,7 +298,15 @@ public class FileViewFragment extends BaseFragment implements
loadingNewClaim = false;
}
} else if (playbackState == Player.STATE_BUFFERING) {
if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0) {
Context ctx = getContext();
boolean sendBufferingEvents = true;
if (ctx != null) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ctx);
sendBufferingEvents = sp.getBoolean(MainActivity.PREFERENCE_KEY_SEND_BUFFERING_EVENTS, true);
}
if (MainActivity.appPlayer != null && MainActivity.appPlayer.getCurrentPosition() > 0 && sendBufferingEvents) {
// we only want to log a buffer event after the media has already started playing
String mediaSourceUrl = getStreamingUrl();
long duration = MainActivity.appPlayer.getDuration();
@@ -357,9 +369,27 @@ public class FileViewFragment extends BaseFragment implements
}
}
if (params.containsKey("url")) {
newUrl = params.get("url").toString();
if (claim == null || !newUrl.equalsIgnoreCase(currentUrl)) {
updateRequired = true;
LbryUri newLbryUri = LbryUri.tryParse(params.get("url").toString());
if (newLbryUri != null) {
newUrl = newLbryUri.toString();
String qs = newLbryUri.getQueryString();
if (!Helper.isNullOrEmpty(qs)) {
String[] qsPairs = qs.split("&");
for (String pair : qsPairs) {
String[] parts = pair.split("=");
if (parts.length < 2) {
continue;
}
if ("comment_hash".equalsIgnoreCase(parts[0])) {
commentHash = parts[1];
break;
}
}
}
if (claim == null || !newUrl.equalsIgnoreCase(currentUrl)) {
updateRequired = true;
}
}
}
} else if (currentUrl != null) {
@@ -567,7 +597,6 @@ public class FileViewFragment extends BaseFragment implements
}
checkOwnClaim();
fetchChannels();
checkAndLoadComments();
}
private String getStreamingUrl() {
@@ -699,6 +728,7 @@ public class FileViewFragment extends BaseFragment implements
}
}
updatePlaybackSpeedView(root);
loadAndScheduleDurations();
}
@@ -709,7 +739,6 @@ public class FileViewFragment extends BaseFragment implements
} else {
onSdkReady();
}
checkCommentSdkInitializing();
}
public void onStop() {
@@ -744,6 +773,7 @@ public class FileViewFragment extends BaseFragment implements
View root = getView();
if (root != null) {
PlayerView view = root.findViewById(R.id.file_view_exoplayer_view);
view.setVisibility(View.VISIBLE);
view.setPlayer(null);
view.setPlayer(MainActivity.appPlayer);
}
@@ -1155,6 +1185,16 @@ public class FileViewFragment extends BaseFragment implements
commentsList.setLayoutManager(commentsListLLM);
}
private void updatePlaybackSpeedView(View root) {
if (root != null) {
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
textPlaybackSpeed.setText(MainActivity.appPlayer != null && MainActivity.appPlayer.getPlaybackParameters() != null ?
Helper.getDisplayValueForPlaybackSpeed((double) MainActivity.appPlayer.getPlaybackParameters().speed) :
DEFAULT_PLAYBACK_SPEED);
}
}
private void deleteCurrentClaim() {
if (claim != null) {
Helper.setViewVisibility(layoutDisplayArea, View.INVISIBLE);
@@ -1469,7 +1509,7 @@ public class FileViewFragment extends BaseFragment implements
}
}
if (claim.isFree()) {
if (claim.isFree() && Helper.isNullOrEmpty(commentHash)) {
if (claim.isPlayable() || (!Lbry.SDK_READY && Lbryio.isSignedIn())) {
if (MainActivity.nowPlayingClaim != null && MainActivity.nowPlayingClaim.getClaimId().equalsIgnoreCase(claim.getClaimId())) {
// claim already playing
@@ -1487,7 +1527,7 @@ public class FileViewFragment extends BaseFragment implements
restoreMainActionButton();
}
if (Lbry.SDK_READY && !claim.isPlayable() && !claim.isViewable()) {
if (Lbry.SDK_READY && !claim.isPlayable() && !claim.isViewable() && Helper.isNullOrEmpty(commentHash)) {
if (claim.getFile() == null) {
loadFile();
} else {
@@ -1513,7 +1553,6 @@ public class FileViewFragment extends BaseFragment implements
private void checkAndLoadComments() {
View root = getView();
if (root != null) {
checkCommentSdkInitializing();
RecyclerView commentsList = root.findViewById(R.id.file_view_comments_list);
if (commentsList == null || commentsList.getAdapter() == null || commentsList.getAdapter().getItemCount() == 0) {
loadComments();
@@ -1521,14 +1560,6 @@ public class FileViewFragment extends BaseFragment implements
}
}
private void checkCommentSdkInitializing() {
View root = getView();
if (root != null) {
TextView commentsSDKInitializing = root.findViewById(R.id.file_view_comments_sdk_initializing);
Helper.setViewVisibility(commentsSDKInitializing, Lbry.SDK_READY ? View.GONE : View.VISIBLE);
}
}
private void showUnsupportedView() {
View root = getView();
if (root != null) {
@@ -2075,10 +2106,21 @@ public class FileViewFragment extends BaseFragment implements
// reset the list view
View root = getView();
if (claim != null && root != null) {
Context context = getContext();
List<Claim> loadingPlaceholders = new ArrayList<>();
for (int i = 0; i < 15; i++) {
Claim placeholder = new Claim();
placeholder.setLoadingPlaceholder(true);
loadingPlaceholders.add(placeholder);
}
relatedContentAdapter = new ClaimListAdapter(loadingPlaceholders, context);
RecyclerView relatedContentList = root.findViewById(R.id.file_view_related_content_list);
relatedContentList.setAdapter(relatedContentAdapter);
String title = claim.getTitle();
String claimId = claim.getClaimId();
ProgressBar relatedLoading = root.findViewById(R.id.file_view_related_content_progress);
Context context = getContext();
boolean canShowMatureContent = false;
if (context != null) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
@@ -2098,10 +2140,14 @@ public class FileViewFragment extends BaseFragment implements
Context ctx = getContext();
if (ctx != null) {
relatedContentAdapter = new ClaimListAdapter(filteredClaims, ctx);
relatedContentAdapter.setItems(filteredClaims);
relatedContentAdapter.setListener(new ClaimListAdapter.ClaimListItemListener() {
@Override
public void onClaimClicked(Claim claim) {
if (claim.isLoadingPlaceholder()) {
return;
}
if (context instanceof MainActivity) {
MainActivity activity = (MainActivity) context;
if (claim.getName().startsWith("@")) {
@@ -2123,6 +2169,10 @@ public class FileViewFragment extends BaseFragment implements
v.findViewById(R.id.file_view_no_related_content),
relatedContentAdapter == null || relatedContentAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
}
// if related content loads before comment, this will affect the scroll position
// so just ensure that we are at the correct position
scrollToCommentHash();
}
}
@@ -2137,9 +2187,9 @@ public class FileViewFragment extends BaseFragment implements
private void loadComments() {
View root = getView();
ProgressBar relatedLoading = root.findViewById(R.id.file_view_comments_progress);
ProgressBar commentsLoading = root.findViewById(R.id.file_view_comments_progress);
if (claim != null && root != null) {
CommentListTask task = new CommentListTask(1, 500, claim.getClaimId(), relatedLoading, new CommentListHandler() {
CommentListTask task = new CommentListTask(1, 200, claim.getClaimId(), commentsLoading, new CommentListHandler() {
@Override
public void onSuccess(List<Comment> comments, boolean hasReachedEnd) {
Context ctx = getContext();
@@ -2167,6 +2217,7 @@ public class FileViewFragment extends BaseFragment implements
relatedContentList.setAdapter(commentListAdapter);
commentListAdapter.notifyDataSetChanged();
scrollToCommentHash();
checkNoComments();
resolveCommentPosters();
}
@@ -2181,6 +2232,20 @@ public class FileViewFragment extends BaseFragment implements
}
}
private void scrollToCommentHash() {
View root = getView();
// check for the position of commentHash if set
if (root != null && !Helper.isNullOrEmpty(commentHash) && commentListAdapter != null && commentListAdapter.getItemCount() > 0) {
RecyclerView commentList = root.findViewById(R.id.file_view_comments_list);
int position = commentListAdapter.getPositionForComment(commentHash);
if (position > -1 && commentList.getLayoutManager() != null) {
NestedScrollView scrollView = root.findViewById(R.id.file_view_scroll_view);
scrollView.requestChildFocus(commentList, commentList);
commentList.getLayoutManager().scrollToPosition(position);
}
}
}
private void checkNoComments() {
View root = getView();
if (root != null) {
@@ -2194,7 +2259,7 @@ public class FileViewFragment extends BaseFragment implements
long st = System.currentTimeMillis();;
List<String> urlsToResolve = new ArrayList<>(commentListAdapter.getClaimUrlsToResolve());
if (urlsToResolve.size() > 0) {
ResolveTask task = new ResolveTask(urlsToResolve, Lbry.SDK_CONNECTION_STRING, null, new ClaimListResultHandler() {
ResolveTask task = new ResolveTask(urlsToResolve, Lbry.LBRY_TV_CONNECTION_STRING, null, new ClaimListResultHandler() {
@Override
public void onSuccess(List<Claim> claims) {
if (commentListAdapter != null) {
@@ -1,27 +1,75 @@
package io.lbry.browser.ui.verification;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.snackbar.Snackbar;
import io.lbry.browser.R;
import io.lbry.browser.listener.SignInListener;
import io.lbry.browser.model.TwitterOauth;
import io.lbry.browser.model.lbryinc.RewardVerified;
import io.lbry.browser.tasks.RewardVerifiedHandler;
import io.lbry.browser.tasks.TwitterOauthHandler;
import io.lbry.browser.tasks.lbryinc.TwitterVerifyTask;
import io.lbry.browser.tasks.verification.TwitterAccessTokenTask;
import io.lbry.browser.tasks.verification.TwitterRequestTokenTask;
import io.lbry.browser.utils.Helper;
import io.lbry.browser.utils.Lbryio;
import lombok.Setter;
public class ManualVerificationFragment extends Fragment {
@Setter
private SignInListener listener;
private PopupWindow popup;
private View mainView;
private View loadingView;
private TwitterOauth currentOauth;
private boolean twitterOauthInProgress = false;
private static final double SKIP_QUEUE_PRICE = 4.99;
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_verification_manual, container, false);
Helper.applyHtmlForTextView((TextView) root.findViewById(R.id.verification_manual_discord_verify));
mainView = root.findViewById(R.id.verification_manual_main);
loadingView = root.findViewById(R.id.verification_manual_loading);
Context context = getContext();
MaterialButton buttonSkipQueue = root.findViewById(R.id.verification_manual_skip_queue);
buttonSkipQueue.setText(context.getString(R.string.skip_queue_button_text, String.valueOf(SKIP_QUEUE_PRICE)));
Helper.applyHtmlForTextView(root.findViewById(R.id.verification_manual_discord_verify));
root.findViewById(R.id.verification_manual_twitter_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// start twitter verification
if (currentOauth != null) {
// Twitter three-legged oauth already completed, verify directly
twitterVerify(currentOauth);
} else {
// show twitter sign-in flow
twitterVerificationFlow();
}
}
});
root.findViewById(R.id.verification_manual_continue_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -31,6 +79,205 @@ public class ManualVerificationFragment extends Fragment {
}
});
root.findViewById(R.id.verification_manual_skip_queue).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onSkipQueueAction();
}
}
});
return root;
}
private void twitterVerificationFlow() {
twitterOauthInProgress = true;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
showLoading();
String consumerKey = getResources().getString(R.string.TWITTER_CONSUMER_KEY);
String consumerSecret = getResources().getString(R.string.TWITTER_CONSUMER_SECRET);
TwitterRequestTokenTask task = new TwitterRequestTokenTask(consumerKey, consumerSecret, new TwitterOauthHandler() {
@Override
public void onSuccess(TwitterOauth twitterOauth) {
twitterOauthInProgress = false;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
showTwitterAuthenticateWithToken(twitterOauth.getOauthToken());
}
@Override
public void onError(Exception error) {
handleFlowError(null);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void showLoading() {
Helper.setViewVisibility(mainView, View.INVISIBLE);
Helper.setViewVisibility(loadingView, View.VISIBLE);
}
public void hideLoading() {
Helper.setViewVisibility(mainView, View.VISIBLE);
Helper.setViewVisibility(loadingView, View.GONE);
}
private void showTwitterAuthenticateWithToken(String oauthToken) {
Context context = getContext();
if (context != null) {
WebView webView = new WebView(context);
webView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
webView.loadUrl(String.format("https://api.twitter.com/oauth/authorize?oauth_token=%s", oauthToken));
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("https://lbry.tv") || url.equalsIgnoreCase("https://twitter.com/home") /* Return to Twitter */) {
if (url.startsWith("https://lbry.tv") && url.contains("oauth_token") && url.contains("oauth_verifier")) {
// finish 3-legged oauth
twitterOauthInProgress = true;
listener.onManualProgress(twitterOauthInProgress);
finishTwitterOauth(url);
}
if (popup != null) {
popup.dismiss();
}
return false;
}
view.loadUrl(url);
return true;
}
});
View popupView = LayoutInflater.from(context).inflate(R.layout.popup_webview, null);
((LinearLayout) popupView.findViewById(R.id.popup_webivew_container)).addView(webView);
popupView.findViewById(R.id.popup_cancel_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!twitterOauthInProgress && popup != null) {
popup.dismiss();
hideLoading();
}
}
});
float scale = getResources().getDisplayMetrics().density;
popup = new PopupWindow(context);
popup.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
if (!twitterOauthInProgress) {
hideLoading();
}
popup = null;
}
});
popup.setWidth(Helper.getScaledValue(340, scale));
popup.setHeight(Helper.getScaledValue(480, scale));
popup.setContentView(popupView);
View parent = getView();
popup.setFocusable(true);
popup.showAtLocation(parent, Gravity.CENTER, 0, 0);
popup.update();
}
}
private void finishTwitterOauth(String callbackUrl) {
String params = callbackUrl.substring(callbackUrl.indexOf('?') + 1);
TwitterAccessTokenTask task = new TwitterAccessTokenTask(params, new TwitterOauthHandler() {
@Override
public void onSuccess(TwitterOauth twitterOauth) {
// send request to finish verifying
currentOauth = twitterOauth;
twitterVerify(twitterOauth);
}
@Override
public void onError(Exception error) {
handleFlowError(null);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void twitterVerify(TwitterOauth twitterOauth) {
Context context = getContext();
if (context != null) {
showLoading();
twitterOauthInProgress = true;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
TwitterVerifyTask task = new TwitterVerifyTask(twitterOauth, null, context, new RewardVerifiedHandler() {
@Override
public void onSuccess(RewardVerified rewardVerified) {
twitterOauthInProgress = false;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
if (Lbryio.currentUser != null) {
Lbryio.currentUser.setRewardApproved(rewardVerified.isRewardApproved());
}
if (rewardVerified.isRewardApproved()) {
if (listener != null) {
listener.onTwitterVerified();
}
} else {
View root = getView();
if (root != null) {
// reward approved wasn't set to true
Snackbar.make(root, getString(R.string.twitter_verification_not_approved), Snackbar.LENGTH_LONG).
setTextColor(Color.WHITE).
setBackgroundTint(Color.RED).show();
}
hideLoading();
}
}
@Override
public void onError(Exception error) {
handleFlowError(error != null ? error.getMessage() : null);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
twitterOauthInProgress = false;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
hideLoading();
}
}
private void handleFlowError(String extra) {
hideLoading();
twitterOauthInProgress = false;
if (listener != null) {
listener.onManualProgress(twitterOauthInProgress);
}
showFlowError(extra);
}
private void showFlowError(String extra) {
Context context = getContext();
View root = getView();
if (context != null && root != null) {
String message = !Helper.isNullOrEmpty(extra) ?
getString(R.string.twitter_account_ineligible, extra) :
getString(R.string.twitter_verification_failed);
Snackbar.make(root, message, Snackbar.LENGTH_LONG).
setTextColor(Color.WHITE).
setBackgroundTint(Color.RED).show();
}
}
}
@@ -20,7 +20,6 @@ import android.provider.MediaStore;
import android.text.method.LinkMovementMethod;
import android.view.ContextMenu;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -32,6 +31,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.gms.common.util.Hex;
import org.bitcoinj.core.Base58;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -70,6 +70,7 @@ public final class Helper {
public static final String METHOD_GET = "GET";
public static final String METHOD_POST = "POST";
public static final String ISO_DATE_FORMAT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS";
public static final String ISO_DATE_FORMAT_JSON = "yyyy-MM-dd'T'HH:mm:ss'Z'";
public static final String SDK_AMOUNT_FORMAT = "0.0#######";
public static final MediaType FORM_MEDIA_TYPE = MediaType.parse("application/x-www-form-urlencoded");
public static final MediaType JSON_MEDIA_TYPE = MediaType.get("application/json; charset=utf-8");
@@ -102,6 +103,11 @@ public final class Helper {
}
}
public static String getDisplayValueForPlaybackSpeed(Double speed) {
DecimalFormat formatter = new DecimalFormat("0.##");
return String.format("%sx", formatter.format(speed));
}
public static String capitalize(String value) {
StringBuilder sb = new StringBuilder();
boolean capitalizeNext = true;
@@ -131,6 +137,16 @@ public final class Helper {
return sb.toString();
}
public static String joinL(List<Long> list, String delimiter) {
StringBuilder sb = new StringBuilder();
String delim = "";
for (Long item : list) {
sb.append(delim).append(item);
delim = delimiter;
}
return sb.toString();
}
public static <T> JSONArray jsonArrayFromList(List<T> values) {
JSONArray array = new JSONArray();
for (T value : values) {
@@ -1,11 +1,16 @@
package io.lbry.browser.utils;
import android.util.Log;
import org.bitcoinj.core.Base58;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -15,6 +20,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import io.lbry.browser.exceptions.ApiCallException;
@@ -128,7 +134,7 @@ public final class Lbry {
IS_STATUS_PARSED = true;
} catch (JSONException | LbryResponseException ex) {
// pass
android.util.Log.e(TAG, "Could not parse status response.", ex);
Log.e(TAG, "Could not parse status response.", ex);
}
}
@@ -520,4 +526,20 @@ public final class Lbry {
}
}
}
public static String generateId() {
return generateId(64);
}
public static String generateId(int numBytes) {
byte[] arr = new byte[numBytes];
new Random().nextBytes(arr);
try {
MessageDigest md = MessageDigest.getInstance("SHA-384");
byte[] hash = md.digest(arr);
return Base58.encode(hash);
} catch (NoSuchAlgorithmException e) {
// pass
return null;
}
}
}
@@ -57,6 +57,7 @@ public final class Lbryio {
public static final String TAG = "Lbryio";
public static final String CONNECTION_STRING = "https://api.lbry.com";
public static final String WS_CONNECTION_BASE_URL = "wss://api.lbry.com/subscribe?auth_token=";
public static final String AUTH_TOKEN_PARAM = "auth_token";
public static List<Subscription> subscriptions = new ArrayList<>();
public static List<Claim> cacheResolvedSubscriptions = new ArrayList<>();
@@ -101,6 +102,7 @@ public final class Lbryio {
}
url = uriBuilder.build().toString();
}
/*if (BuildConfig.DEBUG) {
Log.d(TAG, String.format("Request Method: %s, Sending request to URL: %s", method, url));
}*/
@@ -230,7 +232,7 @@ public final class Lbryio {
}
}
android.util.Log.e(TAG, "Could not retrieve the current user", ex);
Log.e(TAG, "Could not retrieve the current user", ex);
return null;
}
}
@@ -308,7 +310,7 @@ public final class Lbryio {
context.sendBroadcast(intent);
}
} catch (Exception ex) {
android.util.Log.e(TAG, "Error sending encrypted auth token action broadcast", ex);
Log.e(TAG, "Error sending encrypted auth token action broadcast", ex);
// pass
}
}
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/red" />
<corners android:radius="16dp" />
</shape>
@@ -24,7 +24,7 @@
android:id="@+id/welcome_progress_bar"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center_vertical"/>
<TextView
android:id="@+id/welcome_wait_text"
@@ -11,12 +11,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/verification_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/verification_close_button"
android:visibility="gone"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:background="?attr/selectableItemBackground"
app:layout_constraintTop_toTopOf="parent"
@@ -29,10 +34,6 @@
android:tint="@color/white" />
</RelativeLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/verification_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/verification_loading_progress"
android:visibility="gone"
+47 -11
View File
@@ -28,20 +28,22 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="24dp">
android:layout_height="wrap_content">
<EditText
android:id="@+id/wunderbar"
android:background="@android:color/transparent"
android:drawableLeft="@drawable/ic_search"
android:layout_centerVertical="true"
android:drawableStart="@drawable/ic_search"
android:drawablePadding="8dp"
android:drawableTint="@color/actionBarForeground"
android:fontFamily="@font/inter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:hint="@string/uri_placeholder"
android:imeOptions="actionGo"
android:inputType="textNoSuggestions"
android:paddingEnd="36dp"
android:selectAllOnFocus="true"
android:singleLine="true"
android:textFontWeight="300"
@@ -52,7 +54,8 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="24dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone">
<ImageView
@@ -61,6 +64,39 @@
android:src="@drawable/ic_close"
android:tint="@color/actionBarForeground" />
</LinearLayout>
<RelativeLayout
android:id="@+id/wunderbar_notifications"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true">
<ImageView
android:id="@+id/notifications_toggle_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_notifications"
android:tint="@color/actionBarForeground" />
<TextView
android:id="@+id/notifications_badge_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_notification_badge"
android:fontFamily="@font/inter"
android:gravity="center_horizontal"
android:minWidth="12dp"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:layout_marginTop="12dp"
android:layout_marginStart="24dp"
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="invisible"
/>
</RelativeLayout>
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
@@ -135,7 +171,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/installation_id_loaded"
@@ -159,7 +195,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/known_tags_loaded"
@@ -183,7 +219,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/exchange_rate_loaded"
@@ -207,7 +243,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/user_authenticated"
@@ -231,7 +267,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/installation_registered"
@@ -255,7 +291,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/subscriptions_loaded"
@@ -279,7 +315,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:text="@string/subscriptions_resolved"
@@ -47,14 +47,14 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/invites_email_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/invites_email_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/invites_email_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:enabled="false"
android:fontFamily="@font/inter"
android:text="@string/invite" />
@@ -24,7 +24,7 @@
android:id="@+id/invites_loading_channels_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -54,11 +54,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/invites_copy_invite_link"
android:layout_toStartOf="@id/invites_copy_invite_link"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="12dp">
android:paddingStart="12dp"
android:paddingEnd="12dp">
<TextView
android:id="@+id/invites_invite_link"
android:clickable="true"
@@ -72,14 +72,14 @@
</LinearLayout>
<ImageButton
android:id="@+id/invites_copy_invite_link"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_copy"
android:tint="@color/lbryGreen"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<TextView
@@ -23,7 +23,7 @@
android:id="@+id/invites_loading_status_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -27,8 +27,8 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@id/reward_driver_icon"
android:layout_marginStart="8dp"
android:layout_toEndOf="@id/reward_driver_icon"
android:fontFamily="@font/inter"
android:lineSpacingMultiplier="1.2"
android:textColor="@color/white"
+17 -17
View File
@@ -51,7 +51,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textColor="@color/white"
@@ -76,8 +76,8 @@
android:fontFamily="@font/inter"
android:text="@string/buy_lbc"
android:layout_marginTop="8dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:textSize="16sp" />
<TextView
@@ -85,8 +85,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/convert_credits"
android:textColorLink="@color/lbryGreen"
@@ -97,7 +97,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:fontFamily="@font/inter"
android:text="@string/convert_credits_bittrex"
android:textColorLink="@color/lbryGreen"
@@ -115,8 +115,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
@@ -129,7 +129,7 @@
android:textColor="@color/lbryGreen" />
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
@@ -155,7 +155,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
@@ -189,9 +189,9 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/wallet_in_tips_label"
android:layout_toEndOf="@id/wallet_in_tips_label"
android:fontFamily="@font/inter"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:text="@string/unlock"
android:textColor="@color/lbryGreen"
android:textSize="14sp"
@@ -201,8 +201,8 @@
android:layout_centerVertical="true"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/wallet_in_tips_label"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/wallet_in_tips_label"
android:visibility="gone" />
</RelativeLayout>
@@ -232,7 +232,7 @@
android:textColor="@color/lbryGreen" />
<LinearLayout
android:orientation="vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
@@ -258,7 +258,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
@@ -288,7 +288,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
android:textAllCaps="true"
@@ -36,7 +36,7 @@
android:id="@+id/wallet_receive_address"
android:clickable="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/wallet_copy_receive_address"
android:layout_toStartOf="@id/wallet_copy_receive_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
@@ -45,21 +45,21 @@
android:letterSpacing="0.05"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:singleLine="true"
android:textAlignment="center"
android:ellipsize="middle" />
<ImageButton
android:id="@+id/wallet_copy_receive_address"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_copy"
android:tint="@color/lbryGreen"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<com.google.android.material.button.MaterialButton
@@ -12,8 +12,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp">
<TextView
android:layout_width="wrap_content"
@@ -63,7 +63,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/loading_transactions"
android:fontFamily="@font/inter"
android:textSize="14sp"
@@ -52,10 +52,10 @@
<TextView
android:id="@+id/wallet_input_currency"
android:layout_toRightOf="@id/wallet_input_layout_amount"
android:layout_toEndOf="@id/wallet_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -65,8 +65,8 @@
<LinearLayout
android:id="@+id/wallet_inline_balance_container"
android:layout_toRightOf="@id/wallet_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/wallet_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -82,21 +82,21 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
<ProgressBar
android:id="@+id/wallet_send_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/wallet_send"
android:layout_toStartOf="@id/wallet_send"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/wallet_send"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+7 -7
View File
@@ -12,7 +12,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:textStyle="bold"
@@ -29,8 +29,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:weightSum="10">
<TextView
android:layout_weight="4"
@@ -66,8 +66,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:weightSum="10">
<TextView
android:layout_weight="4"
@@ -106,8 +106,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:weightSum="2">
<TextView
@@ -24,7 +24,7 @@
android:textFontWeight="300" />
<ProgressBar
android:id="@+id/comment_form_channels_loading"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
@@ -57,12 +57,12 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp">
android:layout_marginStart="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginRight="40dp">
android:layout_marginEnd="40dp">
<TextView
android:id="@+id/comment_form_replying_to_text"
android:layout_width="wrap_content"
@@ -87,7 +87,7 @@
android:id="@+id/comment_form_clear_reply_to"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="36dp"
android:layout_height="36dp">
<ImageView
@@ -136,8 +136,8 @@
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/comment_form_avatar_container"
android:layout_marginLeft="16dp">
android:layout_toEndOf="@id/comment_form_avatar_container"
android:layout_marginStart="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/comment_form_body"
android:hint="@string/comment"
@@ -179,8 +179,8 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/comment_form_post"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/comment_form_post"
android:layout_marginStart="24dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
@@ -42,10 +42,10 @@
<TextView
android:id="@+id/inline_channel_form_inline_currency"
android:layout_toRightOf="@id/inline_channel_form_layout_deposit"
android:layout_toEndOf="@id/inline_channel_form_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -55,8 +55,8 @@
<LinearLayout
android:id="@+id/inline_channel_form_inline_balance_container"
android:layout_toRightOf="@id/inline_channel_form_inline_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/inline_channel_form_inline_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -72,7 +72,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -105,15 +105,15 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/inline_channel_form_create_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/inline_channel_form_create_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/inline_channel_form_create_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/create"/>
+55 -7
View File
@@ -33,6 +33,53 @@
android:layout_height="match_parent" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/notifications_container"
android:background="@color/pageBackground"
android:elevation="6dp"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ProgressBar
android:id="@+id/notifications_progress"
android:layout_centerInParent="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/notification_list_empty_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="36dp"
android:visibility="gone">
<ImageView
android:layout_gravity="center_horizontal"
android:layout_width="160dp"
android:layout_height="300dp"
android:adjustViewBounds="true"
android:src="@drawable/gerbil_happy" />
<TextView
android:text="@string/no_notifications"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_gravity="center_horizontal"
android:fontFamily="@font/inter"
android:textSize="16sp"
android:textAlignment="center" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/notifications_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:clipToPadding="false"
/>
</RelativeLayout>
<include layout="@layout/floating_wallet_balance" />
<RelativeLayout
@@ -42,6 +89,7 @@
android:background="@color/lbryGreen"
android:elevation="12dp"
android:padding="8dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout
android:layout_width="wrap_content"
@@ -56,7 +104,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:text="@string/sdk_initializing"
android:textSize="14sp"
@@ -70,8 +118,8 @@
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:visibility="gone"
app:cardElevation="8dp"
@@ -85,9 +133,9 @@
android:layout_width="160dp"
android:layout_height="90dp" />
<LinearLayout
android:layout_toRightOf="@id/global_now_playing_player_view"
android:layout_toLeftOf="@id/global_now_playing_close"
android:layout_marginLeft="8dp"
android:layout_toEndOf="@id/global_now_playing_player_view"
android:layout_toStartOf="@id/global_now_playing_close"
android:layout_marginStart="8dp"
android:layout_centerVertical="true"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -117,7 +165,7 @@
android:layout_width="36dp"
android:layout_alignParentEnd="true"
android:clickable="true"
android:layout_marginLeft="8dp">
android:layout_marginStart="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
@@ -4,8 +4,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +19,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/content_from_past_24_hours_item"
@@ -41,7 +41,7 @@
android:id="@+id/content_from_past_24_hours_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -67,7 +67,7 @@
android:id="@+id/content_from_past_week_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -93,7 +93,7 @@
android:id="@+id/content_from_past_month_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -119,7 +119,7 @@
android:id="@+id/content_from_past_year_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -145,7 +145,7 @@
android:id="@+id/content_from_all_time_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -4,8 +4,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +19,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/content_scope_everyone_item"
@@ -37,10 +37,10 @@
android:layout_centerVertical="true"
android:text="@string/fa_globe_americas" />
<TextView
android:layout_toRightOf="@+id/content_scope_everyone_item_icon"
android:layout_toEndOf="@+id/content_scope_everyone_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/everyone"
@@ -50,7 +50,7 @@
android:id="@+id/content_scope_everyone_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -72,10 +72,10 @@
android:layout_centerVertical="true"
android:text="@string/fa_hashtag" />
<TextView
android:layout_toRightOf="@+id/content_scope_tags_item_icon"
android:layout_toEndOf="@+id/content_scope_tags_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/tags_you_follow"
@@ -85,7 +85,7 @@
android:id="@+id/content_scope_tags_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
+13 -13
View File
@@ -4,8 +4,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,8 +19,8 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" />
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" />
<RelativeLayout
android:id="@+id/sort_by_trending_item"
@@ -37,10 +37,10 @@
android:src="@drawable/ic_trending"
android:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_trending_item_icon"
android:layout_toEndOf="@+id/sort_by_trending_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/trending_content"
@@ -50,7 +50,7 @@
android:id="@+id/sort_by_trending_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -72,10 +72,10 @@
android:src="@drawable/ic_new"
android:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_new_item_icon"
android:layout_toEndOf="@+id/sort_by_new_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/new_content"
@@ -85,7 +85,7 @@
android:id="@+id/sort_by_new_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -107,10 +107,10 @@
android:src="@drawable/ic_top"
android:tint="@color/foreground" />
<TextView
android:layout_toRightOf="@+id/sort_by_top_item_icon"
android:layout_toEndOf="@+id/sort_by_top_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/top_content"
@@ -120,7 +120,7 @@
android:id="@+id/sort_by_top_item_selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_check"
android:tint="@color/lbryGreen"
@@ -50,7 +50,7 @@
android:text="@string/channel_to_show_support_as" />
<ProgressBar
android:id="@+id/create_support_channel_progress"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
@@ -83,10 +83,10 @@
<TextView
android:id="@+id/create_support_input_currency"
android:layout_toRightOf="@id/create_support_input_layout_amount"
android:layout_toEndOf="@id/create_support_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -96,8 +96,8 @@
<LinearLayout
android:id="@+id/create_support_inline_balance_container"
android:layout_toRightOf="@id/create_support_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/create_support_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -113,7 +113,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -148,9 +148,9 @@
android:id="@+id/create_support_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/create_support_send"
android:layout_toStartOf="@id/create_support_send"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
@@ -159,7 +159,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/send_lbc_tip"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</LinearLayout>
@@ -8,8 +8,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -23,22 +23,22 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/customize_tags_followed_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<TextView
android:id="@+id/customize_no_followed_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="6dp"
android:fontFamily="@font/inter"
android:text="@string/no_followed_tags"
@@ -51,23 +51,23 @@
android:layout_height="0.5dp"
android:background="@color/divider"
android:layout_marginTop="10dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/customize_tags_suggested_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<TextView
android:id="@+id/customize_no_tag_results"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="6dp"
android:fontFamily="@font/inter"
android:text="@string/no_tag_results"
@@ -79,8 +79,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/customize_tag_filter_input"
@@ -97,8 +97,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:fontFamily="@font/inter"
android:text="@string/done" />
+3 -3
View File
@@ -22,7 +22,7 @@
android:id="@+id/discover_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -46,8 +46,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/done" />
+11 -11
View File
@@ -74,7 +74,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/repost_name_prefix"
android:layout_toEndOf="@id/repost_name_prefix"
android:fontFamily="@font/inter"
android:singleLine="true"
android:textSize="14sp"
@@ -107,10 +107,10 @@
<TextView
android:id="@+id/repost_input_currency"
android:layout_toRightOf="@id/repost_input_layout_amount"
android:layout_toEndOf="@id/repost_input_layout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -120,8 +120,8 @@
<LinearLayout
android:id="@+id/repost_inline_balance_container"
android:layout_toRightOf="@id/repost_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/repost_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -137,7 +137,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
@@ -165,8 +165,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/repost_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/repost_button"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:text="@string/show_advanced" />
@@ -174,9 +174,9 @@
android:id="@+id/repost_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toLeftOf="@id/repost_button"
android:layout_toStartOf="@id/repost_button"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/repost_button"
@@ -184,7 +184,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/repost"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
</LinearLayout>
@@ -14,7 +14,7 @@
android:layout_centerVertical="true"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_toLeftOf="@id/player_play_pause">
android:layout_toStartOf="@id/player_play_pause">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
@@ -66,7 +66,7 @@
android:layout_centerVertical="true"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_toRightOf="@id/player_play_pause">
android:layout_toEndOf="@id/player_play_pause">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
@@ -84,7 +84,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:visibility="gone">
<ImageView
android:id="@+id/player_image_cast_toggle"
@@ -103,14 +103,14 @@
android:layout_alignParentBottom="true"
android:layout_width="56dp"
android:layout_height="48dp"
android:layout_toLeftOf="@id/player_toggle_fullscreen">
android:layout_toStartOf="@id/player_toggle_fullscreen">
<TextView
android:id="@+id/player_playback_speed_label"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/inter"
android:letterSpacing="0.05"
android:singleLine="true"
@@ -126,7 +126,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
android:layout_alignParentEnd="true">
<ImageView
android:id="@+id/player_image_full_screen_toggle"
android:layout_width="24dp"
@@ -140,9 +140,9 @@
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/player_playback_speed"
android:paddingLeft="16dp"
android:paddingRight="4dp">
android:layout_toStartOf="@id/player_playback_speed"
android:paddingStart="16dp"
android:paddingEnd="4dp">
<TextView
android:id="@+id/player_duration_elapsed"
android:layout_width="64dp"
@@ -155,12 +155,12 @@
android:textSize="14sp" />
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_toLeftOf="@id/player_duration_total"
android:layout_toRightOf="@id/player_duration_elapsed"
android:layout_toStartOf="@id/player_duration_total"
android:layout_toEndOf="@id/player_duration_elapsed"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_centerVertical="true"
app:scrubber_color="@color/scrubberColor"
app:played_color="@color/playedColor"
@@ -170,7 +170,7 @@
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:gravity="end"
android:fontFamily="@font/inter"
android:singleLine="true"
@@ -6,7 +6,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:elevation="4dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
@@ -19,8 +19,8 @@
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="44dp"
android:paddingStart="8dp"
android:paddingEnd="44dp"
android:visibility="invisible">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="16dp"
@@ -33,7 +33,7 @@
android:id="@+id/floating_reward_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:textColor="@color/white"
@@ -51,11 +51,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/floating_reward_container"
android:layout_marginLeft="-36dp"
android:layout_marginStart="-36dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="12dp"
android:paddingRight="16dp">
android:paddingStart="12dp"
android:paddingEnd="16dp">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="16dp"
android:layout_height="16dp"
@@ -73,7 +73,7 @@
android:id="@+id/floating_balance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:fontFamily="@font/inter"
android:textColor="@color/white"
@@ -87,7 +87,7 @@
android:layout_gravity="center_vertical"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
@@ -25,8 +25,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/all_content_page_title"
android:layout_width="wrap_content"
@@ -41,7 +41,7 @@
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
@@ -50,8 +50,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@@ -76,7 +76,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -85,10 +85,10 @@
<TextView
android:id="@+id/all_content_for_prefix"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -96,12 +96,12 @@
android:visibility="gone" />
<LinearLayout
android:id="@+id/all_content_scope_link"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_centerVertical="true"
android:visibility="gone">
<TextView
@@ -109,7 +109,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -117,7 +117,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -126,10 +126,10 @@
<TextView
android:id="@+id/all_content_from_prefix"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_toEndOf="@id/all_content_sort_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -142,15 +142,15 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/all_content_sort_link"
android:layout_marginStart="2dp"
android:layout_toEndOf="@id/all_content_sort_link"
android:visibility="gone">
<TextView
android:id="@+id/all_content_time_link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -158,7 +158,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -170,7 +170,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="true"
android:fontFamily="@font/inter"
+15 -15
View File
@@ -19,7 +19,7 @@
<ProgressBar
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
@@ -53,18 +53,18 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_above="@+id/channel_view_tabs"
android:layout_toRightOf="@id/channel_view_icon_container"
android:layout_toEndOf="@id/channel_view_icon_container"
android:orientation="vertical">
<TextView
android:id="@+id/channel_view_title"
android:background="@color/channelCoverBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:ellipsize="end"
@@ -80,8 +80,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:fontFamily="@font/inter"
@@ -95,7 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingLeft="110dp"
android:paddingStart="110dp"
app:tabGravity="fill"
app:tabMode="scrollable"/>
<RelativeLayout
@@ -103,7 +103,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginBottom="12dp">
<RelativeLayout
android:layout_centerHorizontal="true"
@@ -143,7 +143,7 @@
android:elevation="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:padding="8dp">
<RelativeLayout
android:id="@+id/channel_view_edit"
@@ -151,7 +151,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone">
<ImageView
android:layout_centerInParent="true"
@@ -166,7 +166,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:visibility="gone">
<ImageView
android:layout_centerInParent="true"
@@ -181,7 +181,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp">
android:layout_marginEnd="8dp">
<ImageView
android:layout_centerInParent="true"
android:layout_width="22dp"
@@ -195,7 +195,7 @@
android:clickable="true"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginRight="8dp">
android:layout_marginEnd="8dp">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_centerInParent="true"
android:layout_width="24dp"
@@ -8,8 +8,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<ProgressBar
android:id="@+id/channel_comments_progress"
android:layout_width="20dp"
@@ -31,16 +31,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp" />
<TextView
android:id="@+id/channel_no_comments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/no_comments"
@@ -52,8 +52,8 @@
android:id="@+id/channel_comments_sdk_initializing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/sdk_initializing_comments"
@@ -27,8 +27,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="visible">
<LinearLayout
android:layout_width="wrap_content"
@@ -53,7 +53,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -66,15 +66,15 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/channel_content_sort_link"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/channel_content_sort_link"
android:visibility="gone">
<TextView
android:id="@+id/channel_content_time_link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="12sp"
@@ -82,7 +82,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -29,7 +29,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true">
<ImageView
@@ -45,16 +45,16 @@
<LinearLayout
android:id="@+id/channel_form_upload_progress"
android:background="@color/channelCoverBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:visibility="gone">
<ProgressBar
android:layout_width="16dp"
@@ -62,7 +62,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/uploading"
android:textColor="@color/white"
@@ -103,7 +103,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
@@ -169,7 +169,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:text="@string/at"
android:visibility="gone" />
</RelativeLayout>
@@ -195,10 +195,10 @@
<TextView
android:id="@+id/channel_form_input_currency"
android:layout_toRightOf="@id/channel_form_input_layout_deposit"
android:layout_toEndOf="@id/channel_form_input_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -208,8 +208,8 @@
<LinearLayout
android:id="@+id/channel_form_inline_balance_container"
android:layout_toRightOf="@id/channel_form_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/channel_form_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -225,7 +225,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -323,8 +323,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@id/channel_form_save_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@id/channel_form_save_button"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:text="@string/show_optional_fields" />
@@ -333,14 +333,14 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="24dp"
android:layout_toLeftOf="@+id/channel_form_save_button"
android:layout_marginEnd="24dp"
android:layout_toStartOf="@+id/channel_form_save_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/channel_form_save_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/save" />
@@ -15,9 +15,9 @@
android:id="@+id/channel_manager_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/channel_manager_list"
@@ -66,9 +66,9 @@
android:id="@+id/channel_manager_fab_new_channel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_add"
android:visibility="gone" />
+36 -49
View File
@@ -19,7 +19,7 @@
<ProgressBar
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
@@ -75,13 +75,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingLeft="6dp"
android:paddingRight="7dp"
android:paddingStart="6dp"
android:paddingEnd="7dp"
android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="12dp"
@@ -95,7 +95,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:fontFamily="@font/inter"
android:textColor="@android:color/black"
android:textSize="14sp"
@@ -136,11 +136,11 @@
android:layout_centerVertical="true"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_toRightOf="@id/file_view_unsupported_gerbil"
android:layout_toEndOf="@id/file_view_unsupported_gerbil"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:layout_centerVertical="true">
<TextView
android:layout_width="wrap_content"
@@ -183,15 +183,15 @@
android:background="?attr/selectableItemBackground"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="4dp">
android:paddingStart="16dp"
android:paddingEnd="4dp">
<LinearLayout
android:id="@+id/file_view_title_layout"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="48dp">
android:layout_marginEnd="48dp">
<TextView
android:id="@+id/file_view_title"
android:layout_width="wrap_content"
@@ -208,7 +208,7 @@
android:id="@+id/file_view_view_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:textSize="12sp"
android:textFontWeight="300"
@@ -226,8 +226,8 @@
<ImageView
android:id="@+id/file_view_desc_toggle_arrow"
android:src="@drawable/ic_arrow_dropdown"
android:layout_toLeftOf="@+id/file_view_title_layout"
android:layout_alignParentRight="true"
android:layout_toStartOf="@+id/file_view_title_layout"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="24dp"
android:layout_height="24dp"
@@ -482,15 +482,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingLeft="16dp"
android:paddingStart="16dp"
android:paddingBottom="12dp"
android:layout_toLeftOf="@id/file_view_icon_follow">
android:layout_toStartOf="@id/file_view_icon_follow">
<RelativeLayout
android:id="@+id/file_view_publisher_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone">
<RelativeLayout
android:layout_centerHorizontal="true"
@@ -545,12 +545,12 @@
android:id="@+id/file_view_icon_follow"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/fa_heart"
android:textColor="@color/red"
android:textSize="20dp" />
@@ -559,12 +559,12 @@
android:id="@+id/file_view_icon_unfollow"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="@string/fa_heart_broken"
android:textSize="20dp"
android:visibility="invisible" />
@@ -591,8 +591,8 @@
android:autoLink="all"
android:textColorLink="@color/lbryGreen"
android:textFontWeight="300"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<LinearLayout
android:id="@+id/file_view_tag_area"
android:orientation="horizontal"
@@ -600,8 +600,8 @@
android:layout_height="wrap_content"
android:layout_weight="10"
android:paddingTop="36dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:layout_weight="2"
android:layout_width="0dp"
@@ -613,7 +613,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/file_view_tag_list"
android:layout_weight="8"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_width="0dp"
android:layout_height="wrap_content" />
</LinearLayout>
@@ -635,8 +635,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -657,8 +657,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/no_related_content"
android:textSize="14sp"
@@ -687,8 +687,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<ProgressBar
android:id="@+id/file_view_comments_progress"
android:layout_width="16dp"
@@ -712,8 +712,8 @@
android:id="@+id/file_view_no_comments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/no_comments"
@@ -721,19 +721,6 @@
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/file_view_comments_sdk_initializing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/inter"
android:text="@string/sdk_initializing_comments"
android:textFontWeight="300"
android:textSize="14sp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/file_view_comments_list"
android:layout_width="match_parent"
+15 -15
View File
@@ -26,8 +26,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/following_page_title"
android:layout_width="wrap_content"
@@ -41,14 +41,14 @@
android:layout_height="16dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
<ProgressBar
android:id="@+id/following_content_progress"
android:visibility="gone"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
@@ -57,8 +57,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone">
<LinearLayout
android:id="@+id/following_sort_link"
@@ -79,7 +79,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -87,12 +87,12 @@
<LinearLayout
android:id="@+id/following_time_link"
android:layout_toRightOf="@id/following_sort_link"
android:layout_toEndOf="@id/following_sort_link"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp"
android:layout_centerVertical="true"
android:visibility="gone">
<TextView
@@ -107,7 +107,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_arrow_dropdown"
android:tint="@color/foreground" />
@@ -118,7 +118,7 @@
android:background="?attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:clickable="true"
android:fontFamily="@font/inter"
@@ -131,8 +131,8 @@
android:id="@+id/following_page_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:text="@string/lbry_works_better"
@@ -188,8 +188,8 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/following_suggested_done_button"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
+1 -1
View File
@@ -80,7 +80,7 @@
android:layout_alignParentBottom="true">
<com.google.android.material.button.MaterialButton
android:id="@+id/invites_get_started_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
+24 -24
View File
@@ -8,8 +8,8 @@
android:id="@+id/library_filter_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp">
<RelativeLayout
android:layout_width="match_parent"
@@ -32,8 +32,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/library_filter_link_downloads"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/library_filter_link_downloads"
android:fontFamily="@font/inter"
android:text="@string/purchases" />
<TextView
@@ -43,8 +43,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@id/library_filter_link_purchases"
android:layout_marginStart="24dp"
android:layout_toEndOf="@id/library_filter_link_purchases"
android:fontFamily="@font/inter"
android:text="@string/history"
android:textSize="14sp" />
@@ -52,7 +52,7 @@
android:id="@+id/library_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<TextView
@@ -61,7 +61,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/stats"
android:textColor="@color/lbryGreen"
@@ -75,8 +75,8 @@
android:layout_below="@id/library_filter_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:visibility="gone">
<LinearLayout
@@ -105,7 +105,7 @@
android:id="@+id/library_storage_stat_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginStart="3dp"
android:fontFamily="@font/inter"
android:text="@string/mb"
android:textColor="@color/lbryGreen"
@@ -119,7 +119,7 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/hide"
@@ -174,13 +174,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_video_icon"
android:layout_toEndOf="@id/library_storage_legend_video_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/video"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -190,7 +190,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -210,13 +210,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_audio_icon"
android:layout_toEndOf="@id/library_storage_legend_audio_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/audio"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -226,7 +226,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -246,13 +246,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_image_icon"
android:layout_toEndOf="@id/library_storage_legend_image_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/images"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -262,7 +262,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
@@ -282,13 +282,13 @@
android:layout_height="10dp"
android:layout_centerVertical="true" />
<TextView
android:layout_toRightOf="@id/library_storage_legend_other_icon"
android:layout_toEndOf="@id/library_storage_legend_other_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/other"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:textFontWeight="300"
android:textSize="12sp" />
@@ -298,7 +298,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/zero_mb"
android:textFontWeight="300"
+4 -4
View File
@@ -26,7 +26,7 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="-1.5dp">
android:layout_marginStart="-1.5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -64,7 +64,7 @@
android:clickable="true"
android:background="@android:color/black"
android:foreground="?attr/selectableItemBackground"
android:layout_toRightOf="@id/publish_vertical_divider"
android:layout_toEndOf="@id/publish_vertical_divider"
android:layout_width="match_parent"
android:layout_height="148.5dp">
<LinearLayout
@@ -106,7 +106,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/publish_photo_upload_divider"
android:layout_toRightOf="@id/publish_vertical_divider">
android:layout_toEndOf="@id/publish_vertical_divider">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -168,7 +168,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:text="@string/loading_videos"
android:textColor="@color/white"
@@ -29,16 +29,16 @@
<LinearLayout
android:id="@+id/publish_form_thumbnail_upload_progress"
android:background="@color/channelCoverBackground"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:visibility="gone">
<ProgressBar
android:layout_width="16dp"
@@ -46,7 +46,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/uploading"
android:textColor="@color/white"
@@ -58,7 +58,7 @@
android:background="@drawable/bg_small_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
@@ -149,7 +149,7 @@
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="16sp" />
@@ -183,7 +183,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<TextView
@@ -191,7 +191,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/publish_form_video_opt_progress"
android:layout_toEndOf="@id/publish_form_video_opt_progress"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:textSize="14sp" />
@@ -243,7 +243,7 @@
android:id="@+id/publish_form_loading_channels"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -280,7 +280,7 @@
android:id="@+id/publish_form_price_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true" />
</RelativeLayout>
@@ -318,8 +318,8 @@
android:entries="@array/publish_currencies"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/publish_form_price_layout"
android:layout_marginLeft="4dp"
android:layout_toEndOf="@+id/publish_form_price_layout"
android:layout_marginStart="4dp"
android:layout_marginTop="24dp" />
</RelativeLayout>
</LinearLayout>
@@ -349,7 +349,7 @@
android:id="@+id/publish_form_generate_address"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -416,10 +416,10 @@
<TextView
android:id="@+id/publish_form_input_currency"
android:layout_toRightOf="@id/publish_form_input_layout_deposit"
android:layout_toEndOf="@id/publish_form_input_layout_deposit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="30dp"
android:fontFamily="@font/inter"
android:text="@string/lbc"
@@ -429,8 +429,8 @@
<LinearLayout
android:id="@+id/publish_form_inline_balance_container"
android:layout_toRightOf="@id/publish_form_input_currency"
android:layout_marginLeft="24dp"
android:layout_toEndOf="@id/publish_form_input_currency"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -446,7 +446,7 @@
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:textFontWeight="300"
android:layout_marginLeft="2dp" />
android:layout_marginStart="2dp" />
</LinearLayout>
</RelativeLayout>
@@ -538,7 +538,7 @@
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="24dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:text="@string/show_extra_fields"
android:textFontWeight="300" />
@@ -546,8 +546,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_marginTop="24dp">
<TextView
android:id="@+id/publish_form_cancel"
@@ -567,14 +567,14 @@
android:layout_centerVertical="true"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="16dp"
android:layout_toLeftOf="@id/publish_form_publish_button"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/publish_form_publish_button"
android:visibility="gone" />
<com.google.android.material.button.MaterialButton
android:id="@+id/publish_form_publish_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:fontFamily="@font/inter"
android:text="@string/publish" />
@@ -15,9 +15,9 @@
android:id="@+id/publishes_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/publishes_list"
@@ -66,9 +66,9 @@
android:id="@+id/publishes_fab_new_publish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_add"
android:visibility="gone" />
+7 -7
View File
@@ -8,8 +8,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
android:paddingStart="16dp"
android:paddingEnd="16dp">
<androidx.cardview.widget.CardView
android:id="@+id/rewards_filter_card"
android:layout_width="match_parent"
@@ -35,8 +35,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@id/rewards_filter_link_unclaimed"
android:layout_marginStart="16dp"
android:layout_toEndOf="@id/rewards_filter_link_unclaimed"
android:fontFamily="@font/inter"
android:text="@string/all"
android:textSize="14sp" />
@@ -44,7 +44,7 @@
android:id="@+id/rewards_list_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
@@ -87,7 +87,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:fontFamily="@font/inter"
android:textSize="24sp"
android:textColor="@color/white" />
@@ -143,7 +143,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/rewards_get_started_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
+1 -1
View File
@@ -11,7 +11,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
@@ -9,8 +9,8 @@
android:id="@+id/transaction_history_no_transactions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:text="@string/no_transactions"
@@ -4,57 +4,134 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
<ProgressBar
android:id="@+id/verification_manual_loading"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:visibility="gone" />
<androidx.core.widget.NestedScrollView
android:id="@+id/verification_manual_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:visibility="visible"
android:layout_margin="36dp">
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:visibility="visible"
android:layout_margin="36dp">
<TextView
android:textSize="28sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/reward_verification"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/get_instantly_verified"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="28sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/inter"
android:text="@string/manual_reward_verification"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/account_undergo_review"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:id="@+id/verification_manual_discord_verify"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/request_to_be_verified"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/enjoy_free_content"
android:textColor="@color/white"
android:textFontWeight="300" />
<com.google.android.material.button.MaterialButton
android:id="@+id/verification_manual_continue_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/continue_text" />
</LinearLayout>
<TextView
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:fontFamily="@font/inter"
android:text="@string/twitter_verification"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/twitter_verification_desc"
android:textColor="@color/white"
android:textFontWeight="300" />
<com.google.android.material.button.MaterialButton
android:id="@+id/verification_manual_twitter_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/twitter_verify" />
<TextView
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:fontFamily="@font/inter"
android:text="@string/skip_queue_verification"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/skip_queue_verification_desc"
android:textColor="@color/white"
android:textFontWeight="300" />
<com.google.android.material.button.MaterialButton
android:id="@+id/verification_manual_skip_queue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/skip_queue_button_text" />
<TextView
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:fontFamily="@font/inter"
android:text="@string/manual_reward_verification"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:id="@+id/verification_manual_discord_verify"
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/request_to_be_verified"
android:textColor="@color/white"
android:textFontWeight="300" />
<TextView
android:textSize="16sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/inter"
android:text="@string/enjoy_free_content"
android:textColor="@color/white"
android:textFontWeight="300" />
<com.google.android.material.button.MaterialButton
android:id="@+id/verification_manual_continue_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fontFamily="@font/inter"
android:text="@string/continue_text" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
@@ -136,8 +136,8 @@
android:id="@+id/verification_phone_verify_progress"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_toRightOf="@id/verification_phone_verify_button"
android:layout_marginLeft="16dp"
android:layout_toEndOf="@id/verification_phone_verify_button"
android:layout_marginStart="16dp"
android:layout_centerVertical="true"
android:visibility="gone" />
@@ -149,7 +149,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:fontFamily="@font/inter"
android:text="@string/edit"
android:textColor="@color/white"
@@ -33,7 +33,7 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginTop="24dp" />
</RelativeLayout>
+1 -1
View File
@@ -95,7 +95,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/wallet_sign_up_button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
+11 -11
View File
@@ -2,8 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:clickable="true"
@@ -32,7 +32,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:textColor="@color/lightForeground"
android:textFontWeight="300"
@@ -41,7 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:fontFamily="@font/inter"
android:text="@string/reposted"
android:textColor="@color/lightForeground"
@@ -83,13 +83,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:visibility="gone">
<io.lbry.browser.ui.controls.SolidIconView
android:layout_width="16dp"
@@ -102,7 +102,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:textFontWeight="300" />
@@ -128,8 +128,8 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@id/claim_media_container">
android:layout_marginStart="16dp"
android:layout_toEndOf="@id/claim_media_container">
<TextView
android:id="@+id/claim_vanity_url"
android:layout_width="wrap_content"
@@ -7,7 +7,7 @@
android:background="@drawable/bg_selected_item"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginRight="2dp">
android:layout_marginEnd="2dp">
<RelativeLayout
android:id="@+id/channel_filter_media_container"
android:layout_width="80dp"
@@ -7,8 +7,8 @@
android:focusable="true"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="8dp">
<RelativeLayout
@@ -46,8 +46,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/comment_avatar_container"
android:layout_marginLeft="16dp"
android:layout_toEndOf="@id/comment_avatar_container"
android:layout_marginStart="16dp"
android:orientation="vertical">
<RelativeLayout
@@ -66,7 +66,7 @@
android:id="@+id/comment_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:fontFamily="@font/inter"
android:textColor="@color/lightGrey"
Loaded 100 of 139 files, more files were not shown because too many files have changed in this diff. Show more