This file contains 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
defaultConfig { | |
applicationId "com.phantomvk.app" | |
minSdkVersion 16 | |
targetSdkVersion 25 | |
versionCode 1 | |
versionName "1.0" | |
//buildConfigFieldDefined values are compiled and can be accessed in Java code BuildConfig. | |
buildConfigField "String", "BUG_REPORT_URL", "\"xx.com\"" | |
} |
This file contains 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
Recyclerview Listview ve gridview'in yerine kullanıbilecek View Holder pattern'i kullanan yeni bir komponent. | |
Bir View'e ihtiyaç olduğunda layoutu inflate eden yeni bir ViewHolder objesi oluşur ve referansı saklanır liste her scroll olduğunda | |
bu objeyi kullanır. Bu nedenle adı recyclerView'miş :) | |
Diğer bir ozelliği LayoutManager, listedeki itemların dizilişlerini belirliyor. | |
1.LinearLayoutManager, klasik ListView | |
2.GridLayoutManager, GridView | |
3.StaggerGridLayoutManager kademeli,sıralı listview | |
This file contains 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
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:color="@color/white" android:state_checked="true" /> | |
<item android:color="@color/white" android:state_pressed="true" /> | |
<item android:color="@color/white" android:state_activated="true" /> | |
<item android:color="@color/black" /> | |
</selector> |
This file contains 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.sjl.util; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import java.util.List; |
This file contains 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
@IntDef({ | |
ApplicationState.FOREGROUND, | |
ApplicationState.BACKGROUND, | |
}) | |
@Retention(RetentionPolicy.SOURCE) | |
public @interface ApplicationState { | |
int FOREGROUND = 0; | |
int BACKGROUND = 1; | |
} |
This file contains 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
1 - Bir event tanımla | |
public class MyEvent{} | |
2 - Eventi yakalayabilmek için Abone olman lazım. | |
EventBus.getDefault().register(this); | |
3 - Bir event gönder gelsin. | |
EventBus.getDefault().post(new MyEvent()); | |
4 - Event geldi merhaba de bakalım :) |
This file contains 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"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:width="144dp" | |
android:height="144dp" | |
android:left="10dp" | |
android:top="10dp"> | |
<shape android:shape="oval"> | |
<solid android:color="@color/white20" /> |
This file contains 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 static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){ | |
mPostCommentResponse.requestStarted(); | |
RequestQueue queue = Volley.newRequestQueue(context); | |
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() { | |
@Override | |
public void onResponse(String response) { | |
mPostCommentResponse.requestCompleted(); | |
} | |
}, new Response.ErrorListener() { | |
@Override |
This file contains 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
- Tanımlama: | |
public enum UserStatus { | |
PENDING, | |
ACTIVE, | |
INACTIVE, | |
DELETED; | |
} | |
- Kullanım: |
This file contains 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
/** | |
* Utility method for showing keyboard. | |
* | |
* @param view which has keyboard focus | |
*/ | |
public static void showKeyboard(View view) { | |
final InputMethodManager inputMethodManager = (InputMethodManager) | |
view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); | |
inputMethodManager.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); | |
} |
OlderNewer