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
| @GET("/data/2.5/weather?q=Yogyakarta,id&appid=2de143494c0b295cca9337e1e96b00e0") | |
| Call<CurrentCity> getCurrentCityCall(); | |
| private void buildSynkc() throws IOException { | |
| StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
| StrictMode.setThreadPolicy(policy); | |
| // Create a very simple REST adapter which points the GitHub API. | |
| Retrofit retrofit = new Retrofit.Builder() |
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
| @GET("/data/2.5/weather?q=Yogyakarta,id&appid=2de143494c0b295cca9337e1e96b00e0") | |
| Observable<CurrentCity> getCurrentCityCallRx(); | |
| private void getWithRx() { | |
| StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
| StrictMode.setThreadPolicy(policy); | |
| Retrofit retrofit = new Retrofit.Builder() | |
| .baseUrl(API_URL) |
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 setToolbar() { | |
| Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | |
| setSupportActionBar(toolbar); | |
| if (toolbar != null) { | |
| setSupportActionBar(toolbar); | |
| toolbar.setTitle("Home"); | |
| toolbar.setTitleTextColor(Color.WHITE); | |
| toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); | |
| toolbar.setNavigationOnClickListener(new View.OnClickListener() { | |
| @Override |
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
| import android.graphics.Color; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.text.Editable; | |
| import android.text.InputFilter; | |
| import android.text.TextWatcher; | |
| import android.view.View; | |
| import android.widget.EditText; |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:background="#ededed" | |
| android:orientation="vertical"> | |
| <ImageView | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" |
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
| /** | |
| * set fragment sctive | |
| * @param fragment | |
| */ | |
| private void setFragment(Fragment fragment) { | |
| mFragmentManager = getSupportFragmentManager(); | |
| mFragmentTransaction = mFragmentManager.beginTransaction(); | |
| mFragmentTransaction.replace(R.id.frameLayout, fragment).commit(); |
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
| .main { | |
| background: url('../image/background.jpg'); | |
| background-position-x: center; | |
| background-size: cover; | |
| height: auto; | |
| left: 0; | |
| min-height: 100%; | |
| min-width: 100%; | |
| position: absolute; |
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 ocittwo.id.ayo_jek.services; | |
| import android.app.Service; | |
| import android.content.Context; | |
| import android.content.DialogInterface; | |
| import android.content.Intent; | |
| import android.location.GpsStatus; | |
| import android.location.Location; | |
| import android.location.LocationListener; | |
| import android.location.LocationManager; |
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
| public Bitmap getThumbnail(Uri uri) throws FileNotFoundException, IOException { | |
| InputStream input = this.getContentResolver().openInputStream(uri); | |
| BitmapFactory.Options onlyBoundsOptions = new BitmapFactory.Options(); | |
| onlyBoundsOptions.inJustDecodeBounds = true; | |
| onlyBoundsOptions.inDither=true;//optional | |
| onlyBoundsOptions.inPreferredConfig=Bitmap.Config.ARGB_8888;//optional | |
| BitmapFactory.decodeStream(input, null, onlyBoundsOptions); | |
| input.close(); |
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.ahmadrosid.inventoryapp.adapter; | |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.net.Uri; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; |