mirror of
				https://github.com/SimpleMobileTools/Simple-Notes.git
				synced 2025-06-05 17:00:23 +02:00 
			
		
		
		
	convert License to kotlin
This commit is contained in:
		| @@ -1,36 +0,0 @@ | |||||||
| package com.simplemobiletools.notes.activities; |  | ||||||
|  |  | ||||||
| import android.content.Intent; |  | ||||||
| import android.net.Uri; |  | ||||||
| import android.os.Bundle; |  | ||||||
|  |  | ||||||
| import com.simplemobiletools.notes.R; |  | ||||||
|  |  | ||||||
| import butterknife.ButterKnife; |  | ||||||
| import butterknife.OnClick; |  | ||||||
|  |  | ||||||
| public class LicenseActivity extends SimpleActivity { |  | ||||||
|  |  | ||||||
|     @Override |  | ||||||
|     protected void onCreate(Bundle savedInstanceState) { |  | ||||||
|         super.onCreate(savedInstanceState); |  | ||||||
|         setContentView(R.layout.activity_license); |  | ||||||
|         ButterKnife.bind(this); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @OnClick(R.id.license_butterknife_title) |  | ||||||
|     public void butterKnifeClicked() { |  | ||||||
|         openUrl(R.string.butterknife_url); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @OnClick(R.id.license_ambilwarna_title) |  | ||||||
|     public void ambilwarnaClicked() { |  | ||||||
|         openUrl(R.string.ambilwarna_url); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     private void openUrl(int id) { |  | ||||||
|         final String url = getResources().getString(id); |  | ||||||
|         final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |  | ||||||
|         startActivity(browserIntent); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @@ -0,0 +1,23 @@ | |||||||
|  | package com.simplemobiletools.notes.activities | ||||||
|  |  | ||||||
|  | import android.content.Intent | ||||||
|  | import android.net.Uri | ||||||
|  | import android.os.Bundle | ||||||
|  | import com.simplemobiletools.notes.R | ||||||
|  | import kotlinx.android.synthetic.main.activity_license.* | ||||||
|  |  | ||||||
|  | class LicenseActivity : SimpleActivity() { | ||||||
|  |  | ||||||
|  |     override fun onCreate(savedInstanceState: Bundle?) { | ||||||
|  |         super.onCreate(savedInstanceState) | ||||||
|  |         setContentView(R.layout.activity_license) | ||||||
|  |         license_butterknife_title.setOnClickListener { openUrl(R.string.butterknife_url) } | ||||||
|  |         license_ambilwarna_title.setOnClickListener { openUrl(R.string.ambilwarna_url) } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private fun openUrl(id: Int) { | ||||||
|  |         val url = resources.getString(id) | ||||||
|  |         val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) | ||||||
|  |         startActivity(browserIntent) | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user