###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
/** Dagger 2 injection in non Activity Java class **/ | |
/** You should generally use constructor injection whenever possible. The call to component.inject(myObject) is mostly to be used for objects which you can not instantiate yourself (like activities or fragments). | |
Constructor injection is basically what you already did: **/ | |
private class MyManager { | |
private SharedPreferencesManager manager; | |
@Inject | |
MyManager(SharedPreferencesManager manager){ | |
this.manager = manager; |
http://stackoverflow.com/questions/16660039/where-is-android-studio-layout-preview |
https://github.com/umano/AndroidSlidingUpPanel/issues/113 | |
//yes. include the sliding panel as a child of the drawer layout. | |
https://github.com/umano/AndroidSlidingUpPanel/issues/271 |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.os.Build; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.widget.TextView; | |
/** | |
* Simple version used in the article: |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.drawable.Drawable; | |
import android.support.v7.widget.AppCompatEditText; | |
import android.util.AttributeSet; | |
import android.util.SparseArray; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
1. Open the Terminal window | |
2. Type the command 'sudo nano open /private/etc/hosts' | |
3. Press the enter | |
4. It will prompt the sudo password | |
5. Enter the password | |
6. Its open the vim editer where you can modifiy and enter the new entry using control+ command. | |
7. The command will display at end of console. |
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
FragmentManager fragmentManager = getFragmentManager() | |
// Or: FragmentManager fragmentManager = getSupportFragmentManager() | |
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); | |
SimpleFragment fragment = new SimpleFragment(); | |
fragmentTransaction.add(R.id.fragment_container, fragment); | |
fragmentTransaction.commit(); |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<fragment android:name="com.example.SimpleFragment" | |
android:id="@+id/simplefragment" | |
android:layout_weight="1" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
public class SampleFragment extends Fragment implements OnClickListener { | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.sample_fragment,container, false); | |
Button nextButton = (Button) view.findViewById(R.id.button_first); | |
nextButton.setOnClickListener(this); | |
return view; | |
} |