Skip to content

Commit

Permalink
update: You can search related video now.
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelycold committed Mar 19, 2020
1 parent b9658b7 commit 71f4cde
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
10 changes: 10 additions & 0 deletions app/src/main/java/com/absolutelycold/axgle/AllVideosFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void AdditionalBoxClicked(int position, View view) {
selectedCardPosition = position;
ArrayList<String> options = new ArrayList<>();
options.add("Add to ur own collection");
options.add("Search Related Videos");
OrderDialogFragment.newInstance(options).show(getChildFragmentManager(), OrderDialogFragment.TAG);
}

Expand All @@ -120,6 +121,15 @@ public void onSortOptionSelected(int position) {
Toast.makeText(getActivity(), "Fail to add. Please to wait for the database loading.", Toast.LENGTH_SHORT).show();
}
break;
case 1:
String keyWords = allVideosInfo.getKeyword(selectedCardPosition);
Intent intent = new Intent(getContext(), SearchResultActivity.class);
intent.putExtra("search_content", keyWords);
intent.putStringArrayListExtra("categories_data", null);
intent.putExtra("needBlur", needBlur);
startActivity(intent);
Toast.makeText(getContext(), "Recommand clicked", Toast.LENGTH_SHORT).show();
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ protected void onCreate(Bundle savedInstanceState) {
decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
decorView.setBackgroundColor(Color.BLACK);

webView = findViewById(R.id.embed_video_web_view);
webView.setBackgroundColor(Color.TRANSPARENT);


webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setSupportMultipleWindows(true);
Expand All @@ -62,4 +60,10 @@ public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}

@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("embedded_url", embeddedUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private class ViewHolder extends RecyclerView.ViewHolder {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.onSortOptionSelected(getAdapterPosition());
mListener. onSortOptionSelected(getAdapterPosition());
dismiss();
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.android.tools.build:gradle:3.6.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 71f4cde

Please sign in to comment.