v1.0.1 - Fixes & New Features
- Fixed single video link on share intent from the new internal api request - Added pull to refresh on history fragment so u dont have to close the app to see recent history elements - Each fragment has now its own titlebar
This commit is contained in:
parent
9230185930
commit
af2c7eefab
8 changed files with 53 additions and 23 deletions
|
|
@ -68,4 +68,5 @@ dependencies {
|
|||
|
||||
implementation("androidx.cardview:cardview:1.0.0")
|
||||
implementation("com.squareup.picasso:picasso:2.8")
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.deniscerri.ytdl;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.Typeface;
|
||||
|
|
@ -15,8 +16,10 @@ import androidx.fragment.app.FragmentTransaction;
|
|||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import android.text.InputType;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -79,15 +82,25 @@ public class HistoryFragment extends Fragment {
|
|||
initViews();
|
||||
|
||||
dbManager = new DBManager(requireContext());
|
||||
initCards();
|
||||
|
||||
SwipeRefreshLayout swipeRefreshLayout = fragmentView.findViewById(R.id.swiperefresh);
|
||||
|
||||
swipeRefreshLayout.setOnRefreshListener(() -> {
|
||||
initCards();
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
});
|
||||
|
||||
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
private void initCards(){
|
||||
linearLayout.removeAllViews();
|
||||
historyObjects = dbManager.merrHistorine();
|
||||
|
||||
System.out.println(historyObjects);
|
||||
|
||||
for(int i = historyObjects.size()-1; i >= 0; i--){
|
||||
createCard(historyObjects.get(i));
|
||||
}
|
||||
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
private int getDp(int value){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.deniscerri.ytdl;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
|
|
|||
|
|
@ -84,13 +84,17 @@ public class MainActivity extends AppCompatActivity{
|
|||
case R.id.home:
|
||||
if(lastFragment == homeFragment){
|
||||
homeFragment.scrollToTop();
|
||||
}else{
|
||||
this.setTitle("YTDLnis");;
|
||||
}
|
||||
replaceFragment(homeFragment);
|
||||
break;
|
||||
case R.id.history:
|
||||
this.setTitle("Historia");;
|
||||
replaceFragment(historyFragment);
|
||||
break;
|
||||
case R.id.settings:
|
||||
this.setTitle("Cilësimet");;
|
||||
replaceFragment(settingsFragment);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.deniscerri.ytdl;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
|
@ -36,7 +39,6 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
|||
private CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
setPreferencesFromResource(R.xml.root_preferences, rootKey);
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ public class YoutubeAPIManager {
|
|||
|
||||
public Video getVideo(String id) throws JSONException {
|
||||
JSONObject res = genericRequest("https://youtube.googleapis.com/youtube/v3/videos?part=snippet&id="+id+"&key="+key);
|
||||
res = res.getJSONObject("snippet");
|
||||
res.put("videoID", res.getString("id"));
|
||||
res = res.getJSONArray("items").getJSONObject(0).getJSONObject("snippet");
|
||||
res.put("videoID", id);
|
||||
res = fixThumbnail(res);
|
||||
|
||||
Video v = createVideofromJSON(res);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/swiperefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:backgroundTintMode="src_over"
|
||||
tools:context=".HomeFragment"
|
||||
android:id="@+id/scrollView1"
|
||||
>
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<LinearLayout
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/linearLayout1"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical" />
|
||||
android:layout_height="match_parent"
|
||||
android:backgroundTintMode="src_over"
|
||||
tools:context=".HomeFragment"
|
||||
android:id="@+id/scrollView1"
|
||||
>
|
||||
|
||||
</ScrollView>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/linearLayout1"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
|
@ -17,7 +17,7 @@ buildscript {
|
|||
|
||||
def versionMajor = 1
|
||||
def versionMinor = 0
|
||||
def versionPatch = 0
|
||||
def versionPatch = 1
|
||||
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
|
||||
|
||||
ext {
|
||||
|
|
|
|||
Loading…
Reference in a new issue