-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from ksvc/v3.0.4-41875
update to v3.0.4-41875
- Loading branch information
Showing
36 changed files
with
1,560 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
89 changes: 89 additions & 0 deletions
89
KSYLiveDemo/app/src/main/java/com/ksyun/media/streamer/demo/StickerFragment.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,89 @@ | ||
package com.ksyun.media.streamer.demo; | ||
|
||
import com.ksyun.live.demo.R; | ||
import android.app.Fragment; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.CheckBox; | ||
import android.widget.TextView; | ||
|
||
import com.ksyun.media.streamer.demo.sticker.window.StickerWindow; | ||
import com.ksyun.media.streamer.kit.KSYStreamer; | ||
|
||
import butterknife.BindView; | ||
import butterknife.ButterKnife; | ||
import butterknife.OnCheckedChanged; | ||
import butterknife.OnClick; | ||
import butterknife.Unbinder; | ||
|
||
/** | ||
* Fragment for Sticker add. | ||
*/ | ||
public class StickerFragment extends Fragment { | ||
|
||
protected Unbinder mUnbinder; | ||
|
||
@BindView(R.id.cb_sticker) | ||
protected CheckBox mShowCheckBox; | ||
@BindView(R.id.tv_sticker) | ||
protected TextView mStickerButton; | ||
protected StickerWindow mStickerWindow; | ||
protected StdCameraActivity mActivity; | ||
|
||
@Nullable | ||
@Override | ||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { | ||
View view = inflater.inflate(R.layout.sticker_fragment, container, false); | ||
mUnbinder = ButterKnife.bind(this, view); | ||
mActivity = (StdCameraActivity) getActivity(); | ||
mStickerWindow = mActivity.mStickerWindow; | ||
mStickerWindow.bindKSYStreamer(mActivity.mStreamer); | ||
return view; | ||
} | ||
|
||
@OnCheckedChanged(R.id.cb_sticker) | ||
protected void onStickerChecked(boolean isChecked) { | ||
mStickerButton.setEnabled(isChecked); | ||
mStickerWindow.setVisibility(isChecked ? View.VISIBLE : View.GONE); | ||
if (isChecked) { | ||
mStickerWindow.showEditSticker(false); | ||
mStickerWindow.showSticker(); | ||
} else { | ||
mStickerWindow.hideSticker(); | ||
} | ||
} | ||
|
||
@OnClick(R.id.tv_sticker) | ||
protected void onStickerClick() { | ||
mStickerWindow.showEditSticker(mShowCheckBox.isChecked()); | ||
} | ||
|
||
|
||
public boolean onBackPressed() { | ||
if (mStickerWindow.isEdit()) { | ||
mStickerWindow.showEditSticker(false); | ||
mStickerWindow.showSticker(); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
protected void onViewSizeChanged() { | ||
if (mShowCheckBox.isChecked()) { | ||
mStickerWindow.hideSticker(); | ||
mStickerWindow.showSticker(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onDestroyView() { | ||
super.onDestroyView(); | ||
if (mStickerWindow != null) { | ||
mStickerWindow.unBindKSYStreamer(); | ||
} | ||
mUnbinder.unbind(); | ||
} | ||
} |
Oops, something went wrong.