Monday, June 13, 2011

More UI work

Ok, well it's 3 in the afternoon. 3:14 to be precise. I spent the morning researching flood insurance. It looks bleak. My rates will double - I'm in a flood zone; and I'm not near a border.

Well, what can you do? Ok. Well, here we go. First of all; I was going to look for the original gif that I'm using in my app (with the photographer's permission). I actually got ahold of him through his youtube account.

Ok - I found it. 3:37 I kind of got screwed up on Google's new Youtube rule's, and got a little distracted into the videos. Gotta cut that out. My original message on Flickr did the trick.

Ok. The next step is to reload the original as a background and see how that works...

First, run quick test to make sure everything ok. Ok; now, I need to log a missing translation.

Ok, I just did I bunch of additional tweaking to the UI. It's 5:25 and I'm starting to drift off to the net. Back to blogging. I'm pretty unhappy about the button color, still. I think it needs to be a kind of yellow, and change the text to brown. How about corn #FBEC5D?

Ok. I'm getting a little messed up on the buttons. It's 5:52.

Probably, I could get away with giving it a background.

Hmmm....one feature that would be really cool is to slightly increase the size if it's kanji, and decrease the size if it's hiragana.

You have 15 minutes. It's 6 pm. go.

Here's the method for determining if it's hiragana or not:

public static boolean isHiragana(char c) {

// Log.d(TAG, "isHiragana");

// hiragana range
int startInt = 0x3041;
int endInt = 0x3097;

// check first char of string for hiragana range
if ((c >= startInt) && (c <= endInt)) {
// it's hiragana
return true;
}

// Log.d(TAG, "exit isHiragana");

// it's not hiragana
return false;
}

Google tells me this is the Katakana range:

Katakana. Range: 30A0–30FF


public static boolean isKatakana(char c) {

// Log.d(TAG, "isHiragana");

// hiragana range
int startInt = 0x30A0;
int endInt = 0x3097;


// check first char of string for hiragana range
if ((c >= startInt) && (c <= endInt)) {

// it's hiragana
return true;
}

// Log.d(TAG, "exit isHiragana");

// it's not hiragana
return false;
}

And then

public static boolean isKana(char c) {
if (isHiragana(c)){
return true;
}
if (isKatakana(c)){
return true;
}

return false;
}

Then,

boolean isKana = Utils.isKana(question.kanji.charAt(0));

if (isKana) {
mDisplayQuestion.setTextSize(30);
} else {
mDisplayQuestion.setTextSize(50);
}

Ok, it's 6:17. Let's see what this does.


It worked! That as a good 20 minuts of programming. The problem is, though, it moves the rest of the display up and down, depending. So, now what do I do? I need to adjust either the padding, or margin, or something.

Ok. It's 6:25. By 6:30, have an understanding of what the alignments are.

style="@style/CodeFont"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="40sp" android:typeface="normal"
android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center"
android:background="#00EBD5A8"
android:layout_marginTop="10dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@color/text_color"/>


It's 10:30. The margin clearly has an effect.

Now, let's eliminate the padding.

And change the margin top to 20.

Let change the font for kana to 40.

You know what? I'm just going to leave it the same.

No comments:

Post a Comment