setting text color for android dark

This commit is contained in:
balzack 2023-03-04 22:05:40 -08:00
parent c2af1b9f71
commit d12f626324
12 changed files with 81 additions and 69 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splashscreen_background"/>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources>
<color name="splashscreen_background">#8FBEA7</color>
</resources>

View File

@ -71,6 +71,7 @@ export const styles = StyleSheet.create({
flex: 1,
textAlign: 'center',
padding: 8,
color: Colors.text,
},
reset: {
marginTop: 16,

View File

@ -106,6 +106,7 @@ export const styles = StyleSheet.create({
flex: 1,
textAlign: 'center',
padding: 8,
color: Colors.text,
},
create: {
marginTop: 16,

View File

@ -71,6 +71,7 @@ export const styles = StyleSheet.create({
flex: 1,
textAlign: 'center',
padding: 8,
color: Colors.text,
},
login: {
marginTop: 16,

View File

@ -71,6 +71,7 @@ export const styles = StyleSheet.create({
flex: 1,
textAlign: 'center',
padding: 8,
color: Colors.text,
},
reset: {
marginTop: 16,

View File

@ -27,7 +27,7 @@ export function useAccountContext() {
syncing.current = true;
try {
const revision = curRevision.current;
const { server, token, guid } = access.current;
const { server, token, guid } = access.current || {};
const status = await getAccountStatus(server, token);
await store.actions.setAccountStatus(guid, status);
await store.actions.setAccountRevision(guid, revision);
@ -51,7 +51,7 @@ export function useAccountContext() {
throw new Error('invalid account state');
}
access.current = session;
const { guid, server, token } = session;
const { guid, server, token } = session || {};
const status = await store.actions.getAccountStatus(guid);
const sealKey = await store.actions.getAccountSealKey(guid);
const revision = await store.actions.getAccountRevision(guid);
@ -68,26 +68,26 @@ export function useAccountContext() {
sync();
},
setNotifications: async (flag) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setAccountNotifications(server, token, flag);
},
setSearchable: async (flag) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setAccountSearchable(server, token, flag);
},
setAccountSeal: async (seal, key) => {
const { guid, server, token } = access.current;
const { guid, server, token } = access.current || {};
await setAccountSeal(server, token, seal);
await store.actions.setAccountSealKey(guid, key);
updateState({ sealKey: key });
},
unlockAccountSeal: async (key) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setAccountSealKey(guid, key);
updateState({ sealKey: key });
},
setLogin: async (username, password) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setAccountLogin(server, token, username, password);
},
resync: async () => {

View File

@ -146,7 +146,7 @@ export function useAppContext() {
if (!access.current) {
throw new Error('invalid session state');
}
const { server, token } = access.current;
const { server, token } = access.current || {};
await removeProfile(server, token);
await clearSession();
await store.actions.clearSession();

View File

@ -103,7 +103,7 @@ export function useCardContext() {
syncing.current = true;
try {
const { server, token, guid } = access.current;
const { server, token, guid } = access.current || {};
const entry = cards.current.get(cardId);
if (entry?.card?.detail.status === 'connected') {
const card = await getCard(server, token, cardId);
@ -129,7 +129,7 @@ export function useCardContext() {
if (access.current && !syncing.current && setRevision.current !== curRevision.current) {
syncing.current = true;
try {
const { server, token, guid } = access.current;
const { server, token, guid } = access.current || {};
const revision = curRevision.current;
const delta = await getCards(server, token, setRevision.current);
for (let card of delta) {
@ -325,36 +325,36 @@ export function useCardContext() {
sync();
},
addCard: async (message) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await addCard(server, token, message);
},
removeCard: async (cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await removeCard(server, token, cardId);
},
setCardConnecting: async (cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setCardConnecting(server, token, cardId);
},
setCardConnected: async (cardId, cardToken, revision) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setCardConnected(server, token, cardId, cardToken,
revision.viewRevision, revision.articleRevision,
revision.channelRevision, revision.profileRevision);
},
setCardConfirmed: async (cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setCardConfirmed(server, token, cardId);
},
getCardOpenMessage: async (cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getCardOpenMessage(server, token, cardId);
},
setCardOpenMessage: async (server, message) => {
return await setCardOpenMessage(server, message);
},
getCardCloseMessage: async (cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getCardCloseMessage(server, token, cardId);
},
setCardCloseMessage: async (server, message) => {
@ -362,7 +362,7 @@ export function useCardContext() {
},
getCardImageUrl: (cardId) => {
const { profileRevision } = cards.current.get(cardId)?.card || {};
const { server, token } = access.current;
const { server, token } = access.current || {};
return getCardImageUrl(server, token, cardId, profileRevision);
},
removeChannel: async (cardId, channelId) => {
@ -419,52 +419,52 @@ export function useCardContext() {
return await getContactChannelTopic(profile?.node, cardToken, channelId, topicId);
},
setContactRevision: async (cardId, revision) => {
const { guid } = acccess.current
const { guid } = acccess.current || {};
await store.actions.setCardRequestStatus(guid, { revision });
updateState({ viewRevision: revision });
},
setChannelReadRevision: async (cardId, channelId, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemReadRevision(guid, cardId, channelId, revision);
setCardChannelField(cardId, channelId, 'readRevision', revision);
},
setChannelSyncRevision: async (cardId, channelId, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemSyncRevision(guid, cardId, channelId, revision);
setCardChannelField(cardId, channelId, 'syncRevision', revision);
},
setChannelTopicMarker: async (cardId, channelId, marker) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemTopicMarker(guid, cardId, channelId, marker);
setCardChannelField(cardId, channelId, 'topicMarker', marker);
},
setChannelMarkerAndSync: async (cardId, channelId, marker, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemMarkerAndSync(guid, cardId, channelId, marker, revision);
setCardChannelField(cardId, channelId, 'topicMarker', marker, 'syncRevision', revision);
},
setCardFlag: async (cardId) => {
const { guid } = acccess.current;
const { guid } = acccess.current || {};
await store.actions.setCardItemBlocked(guid, cardId);
setCardField(cardId, 'blocked', true);
},
clearCardFlag: async (cardId) => {
const { guid } = acccess.current;
const { guid } = acccess.current || {};
await store.actions.clearCardItemBlocked(guid, cardId);
setCardField(cardId, 'blocked', false);
},
setChannelFlag: async (cardId, channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemBlocked(guid, cardId, channelId);
setCardChannelField(cardId, channelId, 'blocked', true);
},
clearChannelFlag: async (cardId, channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemBlocked(guid, cardId, channelId);
setCardChannelField(cardId, channelId, 'blocked', false);
},
setTopicFlag: async (cardId, channelId, topicId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelTopicBlocked(guid, cardId, channelId, topicId, true);
},
clearTopicFlag: async (cardId, channelId, topicId) => {
@ -490,33 +490,33 @@ export function useCardContext() {
return await setContactChannelNotifications(profile?.node, token, channelId, notify);
},
getTopicItems: async (cardId, channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.getCardChannelTopicItems(guid, cardId, channelId);
},
setTopicItem: async (cardId, channelId, topicId, topic) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.setCardChannelTopicItem(guid, cardId, channelId, topicId, topic);
},
clearTopicItem: async (cardId, channelId, topicId) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.clearCardChannelTopicItem(guid, cardId, channelId, topicId);
},
clearTopicItems: async (cardId, channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.clearCardChannelTopicItems(guid, cardId, channelId);
},
setUnsealedChannelSubject: async (cardId, channelId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemUnsealedDetail(guid, cardId, channelId, revision, unsealed);
setCardChannelField(cardId, channelId, 'unsealedDetail', unsealed);
},
setUnsealedChannelSummary: async (cardId, channelId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelItemUnsealedSummary(guid, cardId, channelId, revision, unsealed);
setCardChannelField(cardId, channelId, 'unsealedSummary', unsealed);
},
setUnsealedTopicSubject: async (cardId, channelId, topicId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setCardChannelTopicItemUnsealedDetail(guid, cardId, channelId, topicId, revision, unsealed);
},
resync: async () => {

View File

@ -142,27 +142,27 @@ export function useChannelContext() {
sync();
},
addChannel: async (type, subject, cards) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await addChannel(server, token, type, subject, cards);
},
removeChannel: async (channelId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await removeChannel(server, token, channelId);
},
setChannelSubject: async (channelId, type, subject) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setChannelSubject(server, token, channelId, type, subject);
},
setChannelCard: async (channelId, cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setChannelCard(server, token, channelId, cardId);
},
clearChannelCard: async (channelId, cardId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await clearChannelCard(server, token, channelId, cardId);
},
addTopic: async (channelId, type, message, files) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
if (files?.length > 0) {
const topicId = await addChannelTopic(server, token, channelId, null, null, null);
upload.actions.addTopic(server, token, channelId, topicId, files, async (assets) => {
@ -183,106 +183,106 @@ export function useChannelContext() {
}
},
removeTopic: async (channelId, topicId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await removeChannelTopic(server, token, channelId, topicId);
},
setTopicSubject: async (channelId, topicId, type, subject) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setChannelTopicSubject(server, token, channelId, topicId, type, subject);
},
getTopicAssetUrl: (channelId, topicId, assetId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return getChannelTopicAssetUrl(server, token, channelId, topicId, assetId);
},
getTopics: async (channelId, revision, count, begin, end) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getChannelTopics(server, token, channelId, revision, count, begin, end);
},
getTopic: async (channelId, topicId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getChannelTopic(server, token, channelId, topicId);
},
resync: async () => {
await sync();
},
getNotifications: async (channelId) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getChannelNotifications(server, token, channelId);
},
setNotifications: async (channelId, notify) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await setChannelNotifications(server, token, channelId, notify);
},
setReadRevision: async (channelId, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemReadRevision(guid, channelId, revision);
setChannelField(channelId, 'readRevision', revision);
},
setSyncRevision: async (channelId, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemSyncRevision(guid, channelId, revision);
setChannelField(channelId, 'syncRevision', revision);
},
setTopicMarker: async (channelId, marker) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemTopicMarker(guid, channelId, revision);
setChannelField(channelId, 'topicMarker', marker);
},
setMarkerAndSync: async (channelId, marker, revision) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemMarkerAndSync(guid, channelId, marker, revision);
setChannelField(channelId, 'topicMarker', marker, 'syncRevision', revision);
},
setChannelFlag: async (channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemBlocked(guid, channelId);
setChannelField(channelId, 'blocked', true);
},
clearChannelFlag: async (channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.clearChannelItemBlocked(guid, channelId);
setChannelField(channelId, 'blocked', false);
},
setTopicFlag: async (channelId, topicId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, 1);
},
clearTopicFlag: async (channelId, topicId) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelTopicBlocked(guid, channelId, topicId, 0);
},
addChannelAlert: async (channelId) => {
const { server, guid } = access.current;
const { server, guid } = access.current || {};
return await addFlag(server, guid, channelId);
},
addTopicAlert: async (channelId, topicId) => {
const { server, guid } = access.current;
const { server, guid } = access.current || {};
return await addFlag(server, guid, channelId, topicId);
},
getTopicItems: async (channelId) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.getChannelTopicItems(guid, channelId);
},
setTopicItem: async (channelId, topic) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.setChannelTopicItem(guid, channelId, topic);
},
clearTopicItem: async (channelId, topicId) => {
const { guid } = access.current;
const { guid } = access.current || {};
return await store.actions.clearChannelTopicItem(guid, channelId, topicId);
},
setUnsealedChannelSubject: async (channelId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemUnsealedDetail(guid, channelId, revision, unsealed);
setChannelField(channelId, 'unsealedDetail', unsealed);
},
setUnsealedChannelSummary: async (channelId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelItemUnsealedSummary(guid, channelId, revision, unsealed);
setChannelField(channelId, 'unsealedSummary', unsealed);
},
setUnsealedTopicSubject: async (channelId, topicId, revision, unsealed) => {
const { guid } = access.current;
const { guid } = access.current || {};
await store.actions.setChannelTopicItemUnsealedDetail(guid, channelId, topicId, revision, unsealed);
},
};

View File

@ -29,7 +29,7 @@ export function useProfileContext() {
try {
const revision = curRevision.current;
const { server, token, guid } = access.current;
const { server, token, guid } = access.current || {};
const identity = await getProfile(server, token);
const imageUrl = identity?.image ? getProfileImageUrl(server, token, revision) : null;
await store.actions.setProfile(guid, identity);
@ -51,7 +51,7 @@ export function useProfileContext() {
const actions = {
setSession: async (session) => {
const { guid, server, token } = session;
const { guid, server, token } = session || {};
const identity = await store.actions.getProfile(guid);
const revision = await store.actions.getProfileRevision(guid);
const imageUrl = identity?.image ? getProfileImageUrl(server, token, revision) : null;
@ -68,15 +68,15 @@ export function useProfileContext() {
sync();
},
setProfileData: async (name, location, description) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setProfileData(server, token, name, location, description);
},
setProfileImage: async (image) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
await setProfileImage(server, token, image);
},
getHandleStatus: async (name) => {
const { server, token } = access.current;
const { server, token } = access.current || {};
return await getHandle(server, token, name);
},
}