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
private Toolbar toolbar; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(getLayoutResource()); | |
toolbar = (Toolbar) findViewById(R.id.toolbar); | |
if (toolbar != null) { | |
setSupportActionBar(toolbar); |
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.example; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class MyClass { | |
public static void main(String[] args){ | |
UserBuild mUserBuild = new UserBuild("INTEGER"); |
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 boolean eMailValidations(String emailstring){ | |
Pattern emailPattern = Pattern.compile(".+@.+\\.[a-z]+"); | |
Matcher emailMatcher = emailPattern.matcher(emailstring); | |
return emailMatcher.matches(); | |
} | |
//call method | |
eMailValidations("jet@jet.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
public String reverseString(String data){ | |
return new StringBuffer(data).reverse().toString(); | |
} |
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
/** | |
* <p>Helper class for managing multiple running embedded activities in the same | |
* process. This class is not normally used directly, but rather created for | |
* you as part of the {@link android.app.ActivityGroup} implementation. | |
* | |
* @see ActivityGroup | |
* | |
* @deprecated Use the new {@link Fragment} and {@link FragmentManager} APIs | |
* instead; these are also | |
* available on older platforms through the Android compatibility package. |
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
/** | |
* 解决listview向上滑动刷新的bug | |
*/ | |
mListView.setOnScrollListener(new AbsListView.OnScrollListener() { | |
@Override | |
public void onScrollStateChanged(AbsListView view, int scrollState) { | |
} | |
@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
this.getWindow().requestFeature(Window.FEATURE_PROGRESS); | |
setContentView(R.layout.main ); | |
final Activity MyActivity = this; | |
// Makes Progress bar Visible | |
getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); | |
webview = (WebView) findViewById(R.id.webview); | |
webview.setWebChromeClient(new WebChromeClient() { | |
public void onProgressChanged(WebView view, int progress) | |
{ |
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
private int getActionBarHeight() { | |
int actionBarHeight = getSupportActionBar().getHeight(); | |
if (actionBarHeight != 0) { | |
return actionBarHeight; | |
} | |
final TypedValue typedValue = new TypedValue(); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
if (getTheme().resolveAttribute(android.R.attr.actionBarSize, typedValue, true)) { | |
actionBarHeight = TypedValue.complexToDimensionPixelSize( |
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
protected final void initStatusBar(int resId) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
SystemBarTintManager tintManager = new SystemBarTintManager(this); | |
tintManager.setStatusBarTintEnabled(true); | |
tintManager.setTintResource(R.color.your_color); | |
SystemBarTintManager.SystemBarConfig config = tintManager.getConfig(); | |
findViewById(resId).setPadding(0, config.getPixelInsetTop(true), 0, config.getPixelInsetBottom()); | |
} | |
} |
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.gitcafe.android.base.fragment; | |
import android.util.Log; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.GregorianCalendar; | |
import java.util.Hashtable; | |
import java.util.regex.Matcher; |
OlderNewer