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
tagFriendsTitle.text = SpannableStringBuilder("tag friend").apply { | |
setSpan(object : ClickableSpan() { | |
override fun onClick(widget: View?) { | |
Log.d("vorobeisj", "click on header") | |
} | |
}, 0, 9, 0) | |
} | |
tagFriendsTitle.movementMethod = LinkMovementMethod.getInstance() |
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
http://archana-testing.blogspot.com/2016/02/calling-google-translation-api-in-java.html |
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
class StringDifference(sw: String, sn: String, cursorStartBefore: Int = 0, cursorEndBefore: Int = 0, cursorStartAfter: Int = 0, cursorEndAfter: Int = 0) { | |
var start: Int = 0 | |
var count: Int = 0 | |
var after: Int = 0 | |
var added: Int = 0 | |
get() = if (count == 0) after else 0 | |
var removed = 0 | |
get() = if (after == 0) count else 0 |
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
package au.sj.sparrow.adblockwebview | |
import android.annotation.SuppressLint | |
import android.graphics.Bitmap | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.webkit.WebChromeClient | |
import android.webkit.WebResourceRequest | |
import android.webkit.WebView | |
import android.webkit.WebViewClient |
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
package com.alexjlockwood.example.delight; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.ImageView; | |
import butterknife.BindView; | |
import butterknife.ButterKnife; | |
import butterknife.OnClick; |
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
android:descendantFocusability="blocksDescendants": | |
<android.support.v4.widget.NestedScrollView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<LinearLayout | |
android:id="@+id/nestedContainer" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
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
class GalleryAdapter(var items:List<DataHolder>) : Adapter<GalleryAdapter.ViewHolder>() { | |
override fun onBindViewHolder(holder: ViewHolder, | |
position: Int) { | |
TODO("not implemented") // File | Settings | File Templates. | |
} | |
override fun getItemCount(): Int = items.size | |
override fun onCreateViewHolder(parent: ViewGroup, | |
viewType: Int): ViewHolder { |
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
<android.support.v4.widget.SwipeRefreshLayout | |
android:id="@+id/rssSwipeRefreshContainer" | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent"> | |
// layouts to refresh |
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
@Entity(tableName = "rss_feeds") | |
class DataHolder(@PrimaryKey(autoGenerate = false) | |
@ColumnInfo(name = "link") | |
var link: String, | |
@ColumnInfo(name = "title") | |
var title: String, | |
@ColumnInfo(name = "date") | |
var date: Long, | |
@ColumnInfo(name = "img_url") | |
var imgUrl: String = "", |
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
rssdetWebView.loadUrl(rssItem.link) | |
rssdetWebView.webChromeClient = object : WebChromeClient() { | |
override fun onProgressChanged(view: WebView?, | |
newProgress: Int) { | |
progressBar.progress = newProgress | |
if (progress == 100) progressBar.visibility = View.GONE | |
else progressBar.visibility = View.VISIBLE | |
} | |
} |