-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Better resources cache implement. + Better font loader + Fix image size in ImageView
- Loading branch information
1 parent
33907bc
commit 892b4c0
Showing
11 changed files
with
113 additions
and
66 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<font> | ||
<font bold="true">@fonts/Roboto/Roboto-Bold</font> | ||
<font>@fonts/Roboto/Roboto-Regular</font> | ||
</font> |
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package br.nullexcept.mux.res; | ||
|
||
import br.nullexcept.mux.graphics.fonts.Typeface; | ||
import br.nullexcept.mux.lang.xml.XmlElement; | ||
|
||
import java.util.HashMap; | ||
|
||
class ResourceCache { | ||
private static final HashMap<String, XmlElement> xmlCache = new HashMap<>(); | ||
private static final HashMap<String, Typeface> fontCache = new HashMap<>(); | ||
|
||
public static XmlElement obtainXml(String path) { | ||
return xmlCache.get(path); | ||
} | ||
|
||
public static boolean hasXml(String path) { | ||
return xmlCache.containsKey(path); | ||
} | ||
|
||
public static Typeface obtainTypeface(String name) { | ||
return fontCache.get(name); | ||
} | ||
|
||
public static boolean hasFont(String path) { | ||
return fontCache.containsKey(path); | ||
} | ||
|
||
public static void store(String path, Typeface typeface) { | ||
fontCache.put(path, typeface); | ||
} | ||
|
||
public static void store(String path, XmlElement xml) { | ||
xmlCache.put(path, xml); | ||
} | ||
} |
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 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 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 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