This file contains hidden or 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
private void connectToRoom(String roomName) { | |
configureAudio(true); | |
ConnectOptions.Builder connectOptionsBuilder = new ConnectOptions.Builder(accessToken) | |
.roomName(roomName); | |
/* | |
* Add local audio track to connect options to share with participants. | |
*/ | |
if (localAudioTrack != null) { | |
connectOptionsBuilder |
This file contains hidden or 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
void drawCustomMethod(Canvas canvas) { | |
int startLine = getTouchedLine(startX, startY); | |
int startCharPos = getCharPositionByTouch(startX, startY, startLine); | |
int currentLine = getTouchedLine(currentX, currentY); | |
int currentCharPos = getCharPositionByTouch(currentX, currentY, currentLine); | |
if(startLine == currentLine) { | |
drawSelection(canvas,startCharPos,currentCharPos,startLine); | |
return; |
This file contains hidden or 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
int getTouchedLine(float y) { | |
int line = 0; | |
for (int i = 0; i < layout.getLineCount(); i++) { | |
if (y > layout.getLineTop(i) && y < layout.getLineBottom(i)) { | |
line = i; | |
break; | |
} | |
} | |
return line; | |
} |
This file contains hidden or 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
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
int action = event.getActionMasked(); | |
float x = event.getX(); | |
float y = event.getY(); | |
switch (action) { | |
case MotionEvent.ACTION_DOWN: | |
startX = x; | |
startY = y; |
This file contains hidden or 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
if (boring == null && isUndefined(desiredWidth) && desiredWidth <= width) { | |
// Is used when the width is not known and the text is not boring, ie. if it contains | |
// unicode characters. | |
layout = new StaticLayout(); | |
} else if (boring != null && boring.width <= width) { | |
// Is used for single-line, boring text when the width is either unknown or bigger | |
// than the width of the text. | |
layout = new BoringLayout(); | |
} else { | |
// Is used for multiline, boring text and the width is known. |
This file contains hidden or 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
private static final String SKU_DOWNLOAD = "DOWNLOAD"; | |
private static final String SKU_STREAMING = "STREAMING"; | |
private static final String SKU_FULL_VERSION = "FULLVERSION"; |
This file contains hidden or 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
private void isUserBuyStreaming() { | |
if (!isCafeInstalled()) { | |
Toast.makeText(this, R.string.cafebazaar_isnot_installed_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
mHelper.queryInventoryAsync(new IabHelper.QueryInventoryFinishedListener() { | |
public void onQueryInventoryFinished(IabResult result, Inventory inventory) { | |
if (result.isFailure()) { | |
Toast.makeText(DetailActivity.this, R.string.query_inventory_error, Toast.LENGTH_SHORT).show(); |
This file contains hidden or 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
private void consumeDownloadPurchase(Purchase purchase) { | |
mHelper.consumeAsync(purchase, new IabHelper.OnConsumeFinishedListener() { | |
@Override | |
public void onConsumeFinished(Purchase purchase, IabResult result) { | |
if (result.isFailure()) { | |
Toast.makeText(DetailActivity.this, R.string.purchasing_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
startDownloading(); | |
} |
This file contains hidden or 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
private void buyDownload() { | |
if (!isCafeInstalled()) { | |
Toast.makeText(this, R.string.cafebazaar_isnot_installed_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} | |
mHelper.launchPurchaseFlow(this, SKU_DOWNLOAD, 1, new IabHelper.OnIabPurchaseFinishedListener() { | |
@Override | |
public void onIabPurchaseFinished(IabResult result, Purchase info) { | |
if (result.isFailure()) { |
This file contains hidden or 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
private void buyFullVersion() { | |
mHelper.launchPurchaseFlow(this, SKU_FULL_VERSION, 1, new IabHelper.OnIabPurchaseFinishedListener() { | |
@Override | |
public void onIabPurchaseFinished(IabResult result, Purchase info) { | |
if (result.isFailure()) { | |
Toast.makeText(DetailActivity.this, R.string.purchasing_error, Toast.LENGTH_SHORT).show(); | |
return; | |
} else if (info.getSku().equals(SKU_FULL_VERSION)) { | |
bookmarkMovie(); | |
} |
NewerOlder