Skip to content

Instantly share code, notes, and snippets.

ThrowJojo

Block or report user

Report or block ThrowJojo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ThrowJojo
ThrowJojo / Share.m
Created Apr 23, 2018
Sharing on LINE.
View Share.m
- (void) shareOnLine: (NSString*) text {
NSString *encodedText = [text stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
NSString *urlString = [NSString stringWithFormat:@"line://msg/text/%@", encodedText];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) {
// Do something on completion
}];
}
@ThrowJojo
ThrowJojo / ExampleFragment.kt
Created Apr 13, 2018
Example of RecyclerView + onScrollListener
View ExampleFragment.kt
class ExampleFragment : Fragment() {
var loading = false
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_example, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
View component.js
this.props.history.go(-2);
@ThrowJojo
ThrowJojo / component.js
Created Apr 6, 2018
Go back once again.
View component.js
this.props.history.go(-1);
View component.js
this.props.history.goBack();
@ThrowJojo
ThrowJojo / Service.kt
Created Apr 2, 2018
findViewById Kotlin
View Service.kt
val textView = overlay?.findViewById<TextView>(R.id.textView)
@ThrowJojo
ThrowJojo / Service.kt
Created Apr 2, 2018
deprecated findViewById
View Service.kt
val textView = overlay?.findViewById(R.id.textView) as TextView
@ThrowJojo
ThrowJojo / MainActivity.kt
Created Mar 23, 2018
Example MainActivity
View MainActivity.kt
package testing.jobdispatcher
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.firebase.jobdispatcher.FirebaseJobDispatcher
import com.firebase.jobdispatcher.GooglePlayDriver
import com.firebase.jobdispatcher.Lifetime
import com.firebase.jobdispatcher.Trigger
class MainActivity : AppCompatActivity() {
@ThrowJojo
ThrowJojo / AndroidManifest.xml
Created Mar 23, 2018
Example manifest file
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="testing.jobdispatcher">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
View TaskService.kt
package testing.jobdispatcher
import android.util.Log
import com.firebase.jobdispatcher.JobParameters
import com.firebase.jobdispatcher.JobService
class TaskService : JobService() {
override fun onStartJob(job: JobParameters?): Boolean {
Log.e(TaskService::class.java.name, "START JOB")
You can’t perform that action at this time.