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.ataulm.mijur.view; | |
import android.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
public class MatchParentWidthImageView extends ImageView { | |
public MatchParentWidthImageView(Context context, AttributeSet attrs) { |
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
username=buzzlightyear | |
password=notachildsplaything |
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
<scheme name="Material Dark" version="142" parent_scheme="Darcula"> | |
<!-- | |
1. Install the Roboto Mono Regular font - https://fonts.google.com/specimen/Roboto+Mono?selection.family=Roboto+Mono | |
2. Copy `Material Dark.icls` to `~/Library/Preferences/AndroidStudio3.0/colors/` | |
3. Restart AS | |
4. Preferences > Editor > Color and Fonts > select Material Dark and press OK | |
--> | |
<option name="FONT_SCALE" value="1.0" /> |
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 interface AppBarExpander { | |
void expandAppBar(); | |
void collapseAppBar(); | |
} | |
public class SeasonsActivity extends AppCompatActivity implements AppBarExpander { | |
... | |
@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
AppBarExpander appBarExpander; | |
... | |
final RecyclerView view = (RecyclerView) layoutInflater.inflate(R.layout.view_season_page, container, false); | |
view.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS); | |
view.setLayoutManager(new LinearLayoutManager(container.getContext()) { | |
@Override | |
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) { |
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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
android:orientation="vertical"> | |
<TextView | |
android:id="@+id/beginning" | |
android:layout_width="wrap_content" |
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
beginning.text = "A Short Story" | |
middle.text = "This is a short story" | |
end.text = "fin." |
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_my) | |
story.text = writeFormattedStory() | |
} | |
private fun writeFormattedStory(): CharSequence { | |
return SpannableStringBuilder() | |
.append(createWithSpans("A Short Story", StyleSpan(Typeface.BOLD))) | |
.append("\n") |
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
/** | |
* Handles the splitting of {@link URLSpan}s into multiple | |
* {@link FeedbackFragment}s. | |
* | |
* @param fragment The fragment containing the spannable text to process. | |
* @param span The individual {@link StyleSpan} that represents the span | |
*/ | |
private static void handleStyleSpan(FeedbackFragment fragment, StyleSpan span) { | |
final int style = span.getStyle(); |
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
/** | |
* Handles {@link FeedbackFragment} with {@link ClickableSpan} (including {@link URLSpan]}). Adds | |
* earcon and pitch information to the fragment. | |
* | |
* @param fragment The fragment containing {@link ClickableSpan}. | |
*/ | |
private static void handleClickableSpan(FeedbackFragment fragment) { | |
final Bundle speechParams = new Bundle(Bundle.EMPTY); | |
speechParams.putFloat(SpeechParam.PITCH, PITCH_CHANGE_HYPERLINK); | |
fragment.setSpeechParams(speechParams); |
OlderNewer