-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
433 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
demo/src/main/java/cn/jzvd/demo/Tab_4_More/SlideZoomActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package cn.jzvd.demo.Tab_4_More; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import android.os.Bundle; | ||
import android.view.MenuItem; | ||
|
||
import com.bumptech.glide.Glide; | ||
|
||
import org.jzvd.jzvideo.UrlsKt; | ||
|
||
import cn.jzvd.JZUtils; | ||
import cn.jzvd.Jzvd; | ||
import cn.jzvd.JzvdStd; | ||
import cn.jzvd.demo.R; | ||
import cn.jzvd.demo.Tab_3_List.ListView.adapter.CommentAdapter; | ||
|
||
public class SlideZoomActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
getSupportActionBar().setDisplayShowHomeEnabled(true); | ||
getSupportActionBar().setDisplayShowTitleEnabled(true); | ||
getSupportActionBar().setDisplayUseLogoEnabled(false); | ||
getSupportActionBar().setTitle(getString(R.string.slide_zoom)); | ||
CommentAdapter commentAdapter = new CommentAdapter(); | ||
setContentView(R.layout.activity_slide_zoom); | ||
JzvdStd mJzvdStd = findViewById(R.id.jzvd); | ||
mJzvdStd.setUp(UrlsKt.getVideos()[14], UrlsKt.getTitles()[14], JzvdStd.SCREEN_NORMAL); | ||
Glide.with(this).load(UrlsKt.getThumbnails()[14]).into(mJzvdStd.posterImageView); | ||
RecyclerView recyclerView = findViewById(R.id.rv_comment); | ||
recyclerView.setLayoutManager(new LinearLayoutManager(this)); | ||
recyclerView.setAdapter(commentAdapter); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
Jzvd.releaseAllVideos(); | ||
} | ||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
Jzvd.goOnPlayOnResume(); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
if (Jzvd.backPress()) { | ||
return; | ||
} | ||
super.onBackPressed(); | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
switch (item.getItemId()) { | ||
case android.R.id.home: | ||
finish(); | ||
break; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
Jzvd.releaseAllVideos(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
demo/src/main/java/cn/jzvd/demo/utils/JzvdDependBehavior.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package cn.jzvd.demo.utils; | ||
|
||
import android.content.Context; | ||
import android.content.res.TypedArray; | ||
import android.util.AttributeSet; | ||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.coordinatorlayout.widget.CoordinatorLayout; | ||
|
||
import cn.jzvd.demo.R; | ||
|
||
|
||
public class JzvdDependBehavior extends CoordinatorLayout.Behavior<View> { | ||
|
||
private int dependId; | ||
|
||
public JzvdDependBehavior() { | ||
|
||
} | ||
|
||
public JzvdDependBehavior(Context context, AttributeSet attributeSet) { | ||
TypedArray array = context.obtainStyledAttributes(attributeSet, R.styleable.JzvdDependBehavior, 0, 0); | ||
dependId = array.getResourceId(R.styleable.JzvdDependBehavior_depend, 0); | ||
array.recycle(); | ||
} | ||
|
||
|
||
@Override | ||
public boolean layoutDependsOn(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) { | ||
return dependId == dependency.getId(); | ||
} | ||
|
||
|
||
@Override | ||
public boolean onMeasureChild(@NonNull CoordinatorLayout parent, | ||
@NonNull View child, | ||
int parentWidthMeasureSpec, | ||
int widthUsed, | ||
int parentHeightMeasureSpec, | ||
int heightUsed) { | ||
|
||
|
||
View dependView = parent.findViewById(dependId); | ||
if (dependView == null) { | ||
return false; | ||
} | ||
parent.onMeasureChild(child, parentWidthMeasureSpec, 0, parentHeightMeasureSpec, dependView.getBottom()); | ||
return true; | ||
} | ||
|
||
|
||
@Override | ||
public boolean onLayoutChild(@NonNull CoordinatorLayout parent, | ||
@NonNull View child, | ||
int layoutDirection) { | ||
View anchorView = parent.findViewById(dependId); | ||
if (anchorView == null) { | ||
return false; | ||
} | ||
parent.onLayoutChild(child, layoutDirection); | ||
child.offsetTopAndBottom(anchorView.getBottom()); | ||
return true; | ||
} | ||
} |
Oops, something went wrong.