Skip to content

Commit

Permalink
Add Easy Diary manual
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoongcho committed Oct 1, 2017
1 parent 9de58c1 commit 14e29a3
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 67 deletions.
23 changes: 21 additions & 2 deletions MANUAL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Easy Diary manual

## Table of Contents
- [TTF 폰트추가](#TTF-폰트추가)
- [Add TTF font](#add-ttf-font)

### TTF 폰트추가
### Add TTF font
When the device language setting is set to Korean or English, the available fonts in this diary are the three fonts provided in the diary and the fonts set in the device.
To use the fonts you own in the diary, simply copy the TTF fonts to the specified location as follows.

#### 01. Check the built-in list
<img src="screenshots/app_easydiary12_01_en.png" width="288" height="512">&nbsp;

#### 02. Check the font directory
If the TTF font file is in the device, use the Explorer installed on the device.
The explorer used in the screenshot is the 'Simple File Manager' Explorer.
If the TTF font file is on your PC, you can use the explorer available on your PC.
<img src="screenshots/app_easydiary12_02_en.png" width="288" height="512">&nbsp;

#### 03. Copy TTF font file to font directory
The font directory for Easy Diary is '/AAFactory/EasyDiary/Fonts/'.
<img src="screenshots/app_easydiary12_03_en.png" width="288" height="512">&nbsp;

#### 04. Check additional fonts
When a TTF file is added to the font directory, the font is added to the font settings list.
<img src="screenshots/app_easydiary12_04_en.png" width="288" height="512">&nbsp;
24 changes: 22 additions & 2 deletions MANUAL_ko.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Easy Diary manual

## Table of Contents
- [Add TTF font](#Add-TTF-font)
- [TTF 폰트추가](#ttf-폰트추가)

### Add TTF font
### TTF 폰트추가
디바이스 언어 설정이 한국어 또는 영어로 설정되어 있는경우 이지다이어리에서 사용가능한 폰트는 다이어리에서 제공하는 3가지 폰트와 디바이스에 설정된 폰트입니다.
사용자가 소유하고 있는 폰트를 이지다이어리에서 사용하려면 다음과 같이 TTF 폰트를 지정된 위치에 복사하면 됩니다.

#### 01. 기본제공 목록확인
<img src="screenshots/app_easydiary12_01.png" width="288" height="512">&nbsp;

#### 02. 폰트디렉토리 확인
TTF 폰트파일이 디바이스에 있는경우 디바이스에 설치된 탐색기를 이용합니다.
스크린샷에서 이용된 탐색기는 'Simple File Manager' 탐색기입니다.
TTF 폰트파일이 PC에 있는경우 PC에서 사용가능한 탐색기를 이용하면 됩니다.
<img src="screenshots/app_easydiary12_02.png" width="288" height="512">&nbsp;

#### 03. 폰트디렉토리에 TTF 폰트파일 복사
이지다이어리의 폰트 디렉토리는 '/AAFactory/EasyDiary/Fonts/' 입니다.
<img src="screenshots/app_easydiary12_03.png" width="288" height="512">&nbsp;


#### 04. 추가폰트 확인
폰트디렉토리에 TTF 파일이 추가되면 폰트설정목록에 해당 폰트가 추가됩니다.
<img src="screenshots/app_easydiary12_04.png" width="288" height="512">&nbsp;
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,44 @@ public class SettingsActivity extends AppCompatPreferenceActivity {

private static int mTaskFlag = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupActionBar();

getFragmentManager().beginTransaction()
.replace(android.R.id.content, new GeneralPreferenceFragment())
.commit();

new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
//ViewGroup viewGroup = (ViewGroup) findViewById(android.R.id.content);

new android.os.Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Window window = getWindow();
View v = window.getDecorView();
determineView((ViewGroup)v);
}
});

}
}).start();

// ViewGroup viewGroup = (ViewGroup) findViewById(android.R.id.content);
//// Window window = getWindow();
//// ViewGroup viewGroup = (ViewGroup) window.getDecorView();
// determineView(viewGroup);

}

@Override
protected void onPause() {
super.onPause();
Expand Down Expand Up @@ -163,30 +201,6 @@ private static void bindPreferenceSummaryToValue(Preference preference) {
// Set the listener to watch for value changes.
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);

File fontDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + Path.USER_CUSTOM_FONTS_DIRECTORY);
if (fontDir.list() != null && fontDir.list().length > 0) {
ListPreference temp = (ListPreference) preference;
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
boolean result = false;
if (FilenameUtils.getExtension(name).equalsIgnoreCase("ttf")) result = true;
return result;
}
};
String[] listFont = fontDir.list(filter);
CharSequence[] entries = new CharSequence[listFont.length + temp.getEntries().length];
CharSequence[] entryValues = new CharSequence[listFont.length + temp.getEntryValues().length];
System.arraycopy(temp.getEntries(), 0, entries, 0, temp.getEntries().length);
System.arraycopy(temp.getEntryValues(), 0, entryValues, 0, temp.getEntryValues().length);
for (int i = 0; i < listFont.length; i++) {
entries[i + temp.getEntries().length] = FilenameUtils.getBaseName(listFont[i]);
entryValues[i + temp.getEntries().length] = listFont[i];
}
temp.setEntries(entries);
temp.setEntryValues(entryValues);
}

// Trigger the listener immediately with the preference's
// current value.
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
Expand All @@ -195,44 +209,6 @@ public boolean accept(File dir, String name) {
.getString(preference.getKey(), ""));
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupActionBar();

getFragmentManager().beginTransaction()
.replace(android.R.id.content, new GeneralPreferenceFragment())
.commit();

new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
//ViewGroup viewGroup = (ViewGroup) findViewById(android.R.id.content);

new android.os.Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Window window = getWindow();
View v = window.getDecorView();
determineView((ViewGroup)v);
}
});

}
}).start();

// ViewGroup viewGroup = (ViewGroup) findViewById(android.R.id.content);
//// Window window = getWindow();
//// ViewGroup viewGroup = (ViewGroup) window.getDecorView();
// determineView(viewGroup);

}

public void determineView(ViewGroup viewGroup) {
for (int i = 0; i < viewGroup.getChildCount(); i++) {
// Log.i("info index ", String.format("%d", i));
Expand Down Expand Up @@ -308,11 +284,45 @@ public void onCreate(Bundle savedInstanceState) {
// guidelines.
// bindPreferenceSummaryToValue(findPreference("example_text"));
// bindPreferenceSummaryToValue(findPreference("example_list"));

updateFontList();
bindPreferenceSummaryToValue(findPreference("font_setting"));
initPreference();
}

@Override
public void onResume() {
super.onResume();
updateFontList();
}

private void updateFontList() {
File fontDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + Path.USER_CUSTOM_FONTS_DIRECTORY);
if (fontDir.list() != null && fontDir.list().length > 0) {
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
boolean result = false;
if (FilenameUtils.getExtension(name).equalsIgnoreCase("ttf")) result = true;
return result;
}
};
String[] listFont = fontDir.list(filter);
String[] embeddedTitles = getResources().getStringArray(R.array.pref_list_fonts_title);
String[] embeddedListValues = getResources().getStringArray(R.array.pref_list_fonts_values);
CharSequence[] entries = new CharSequence[listFont.length + embeddedTitles.length];
CharSequence[] entryValues = new CharSequence[listFont.length + embeddedListValues.length];
System.arraycopy(embeddedTitles, 0, entries, 0, embeddedTitles.length);
System.arraycopy(embeddedListValues, 0, entryValues, 0, embeddedListValues.length);
for (int i = 0; i < listFont.length; i++) {
entries[i + embeddedTitles.length] = FilenameUtils.getBaseName(listFont[i]);
entryValues[i + embeddedListValues.length] = listFont[i];
}
ListPreference temp = (ListPreference) findPreference("font_setting");
temp.setEntries(entries);
temp.setEntryValues(entryValues);
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
Expand Down
Binary file added screenshots/app_easydiary12_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_01_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_02_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_03_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/app_easydiary12_04_en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 14e29a3

Please sign in to comment.