Skip to content

Instantly share code, notes, and snippets.

String strings = Utils.decodeString(mChannelObj.getDescription());
tvDescription.setVisibility(VISIBLE);
descriptionDivView.setVisibility(VISIBLE);
SpannableStringBuilder span = new SpannableStringBuilder(strings);
Pattern webPattern = Patterns.WEB_URL;
Matcher matcher = webPattern.matcher(Utils.decodeString(mChannelObj.getDescription()));
while (matcher.find()) {
ClickableSpan clickableSpan = new ClickableSpan() {
@Override
@bansalayush
bansalayush / AndroidTouch
Created May 15, 2020 11:39
Check if the current focus in within a given view or outside of a view
View v = getCurrentFocus(); // get current view in focus
//get x,y coordinates of view
int[] scrcoords = new int[2];
v.getLocationOnScreen(scrcoords);
float x = ev.getRawX() + v.getLeft() - scrcoords[0];
float y = ev.getRawY() + v.getTop() - scrcoords[1];
//check if the touch was outside the current view
if (x < v.getLeft() || x > v.getRight() || y < v.getTop() || y > v.getBottom()) {
@bansalayush
bansalayush / HostingOnFirebase.txt
Last active August 25, 2021 18:08
Hosting a website on firebase
Hosting a website on firebase
Go to project dir
- <b>npm install -g firebase-tools</b>
- <b>firebase login</b>
- Login successfully before executing any other command
- <b>firebase init</b>
- Select hosting feature and github deploy actions
- Procceed
- Select a Project where this will be deployed
- Test website on local machine with firebase serve