author int64 658 755k | date stringlengths 19 19 | timezone int64 -46,800 43.2k | hash stringlengths 40 40 | message stringlengths 5 490 | mods list | language stringclasses 20 values | license stringclasses 3 values | repo stringlengths 5 68 | original_message stringlengths 12 491 |
|---|---|---|---|---|---|---|---|---|---|
129,187 | 03.02.2023 21:19:06 | 18,000 | 8db70b4db443adcd868f5f5dafdf39f37fbb9070 | [lib][keyserver] Allow notificationTexts to render EntityText
Summary:
This diff adds support to `keyserver` for resolving `EntityText` returned by a message spec's `notificationTexts` function.
Depends on D6573
Test Plan: Tested in combination with later notif diffs
Reviewers: atul, ginsu, michal, marcin
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "keyserver/src/push/send.js",
"new_path": "keyserver/src/push/send.js",
"diff": "@@ -39,6 +39,7 @@ import { fetchCollapsableNotifs } from '../fetchers/message-fetchers';\nimport { fetchServerThreadInfos } from '../fetchers/thread-fetchers';\nimport { fetchUserInfos } from '../fetchers/user-fetchers';\nimport type { Viewer } from '../session/viewer';\n+import { getENSNames } from '../utils/ens-cache';\nimport { getAPNsNotificationTopic } from './providers';\nimport {\napnPush,\n@@ -488,6 +489,7 @@ async function prepareIOSNotification(\nconst { merged, ...rest } = await notifTextsForMessageInfo(\nallMessageInfos,\nthreadInfo,\n+ getENSNames,\n);\nif (!badgeOnly) {\nnotification.body = merged;\n@@ -547,6 +549,7 @@ async function prepareAndroidNotification(\nconst { merged, ...rest } = await notifTextsForMessageInfo(\nallMessageInfos,\nthreadInfo,\n+ getENSNames,\n);\nconst notification = {\ndata: {\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/shared/notif-utils.js",
"new_path": "lib/shared/notif-utils.js",
"diff": "@@ -8,10 +8,16 @@ import {\ntype RobotextMessageInfo,\ntype MessageType,\n} from '../types/message-types';\n-import type { NotifTexts } from '../types/notif-types';\n+import type { ResolvedNotifTexts } from '../types/notif-types';\nimport type { ThreadInfo, ThreadType } from '../types/thread-types';\nimport type { RelativeUserInfo } from '../types/user-types';\n-import { entityTextToRawString } from '../utils/entity-text';\n+import type { GetENSNames } from '../utils/ens-helpers';\n+import {\n+ getEntityTextAsString,\n+ entityTextToRawString,\n+ type EntityText,\n+} from '../utils/entity-text';\n+import { promiseAll } from '../utils/promises';\nimport { trimText } from '../utils/text-utils';\nimport { robotextForMessageInfo } from './message-utils';\nimport { messageSpecs } from './messages/message-specs';\n@@ -21,10 +27,12 @@ import { stringForUser } from './user-utils';\nasync function notifTextsForMessageInfo(\nmessageInfos: MessageInfo[],\nthreadInfo: ThreadInfo,\n-): Promise<NotifTexts> {\n+ getENSNames: ?GetENSNames,\n+): Promise<ResolvedNotifTexts> {\nconst fullNotifTexts = await fullNotifTextsForMessageInfo(\nmessageInfos,\nthreadInfo,\n+ getENSNames,\n);\nconst merged = trimText(fullNotifTexts.merged, 300);\nconst body = trimText(fullNotifTexts.body, 300);\n@@ -80,19 +88,61 @@ function mostRecentMessageInfoType(\nasync function fullNotifTextsForMessageInfo(\nmessageInfos: $ReadOnlyArray<MessageInfo>,\nthreadInfo: ThreadInfo,\n-): Promise<NotifTexts> {\n+ getENSNames: ?GetENSNames,\n+): Promise<ResolvedNotifTexts> {\nconst mostRecentType = mostRecentMessageInfoType(messageInfos);\nconst messageSpec = messageSpecs[mostRecentType];\ninvariant(\nmessageSpec.notificationTexts,\n`we're not aware of messageType ${mostRecentType}`,\n);\n- return await messageSpec.notificationTexts(messageInfos, threadInfo, {\n+ const innerNotificationTexts = (\n+ innerMessageInfos: $ReadOnlyArray<MessageInfo>,\n+ innerThreadInfo: ThreadInfo,\n+ ) =>\n+ fullNotifTextsForMessageInfo(\n+ innerMessageInfos,\n+ innerThreadInfo,\n+ getENSNames,\n+ );\n+ const unresolvedNotifTexts = await messageSpec.notificationTexts(\n+ messageInfos,\n+ threadInfo,\n+ {\nnotifThreadName,\nnotifTextForSubthreadCreation,\nstrippedRobotextForMessageInfo,\n- notificationTexts: fullNotifTextsForMessageInfo,\n+ notificationTexts: innerNotificationTexts,\n+ },\n+ );\n+\n+ const resolveToString = async (\n+ entityText: string | EntityText,\n+ ): Promise<string> => {\n+ if (typeof entityText === 'string') {\n+ return entityText;\n+ }\n+ const notifString = await getEntityTextAsString(entityText, getENSNames, {\n+ prefixThisThreadNounWith: 'your',\n});\n+ invariant(\n+ notifString !== null && notifString !== undefined,\n+ 'getEntityTextAsString only returns falsey when passed falsey',\n+ );\n+ return notifString;\n+ };\n+ let promises = {\n+ merged: resolveToString(unresolvedNotifTexts.merged),\n+ body: resolveToString(unresolvedNotifTexts.body),\n+ title: resolveToString(unresolvedNotifTexts.title),\n+ };\n+ if (unresolvedNotifTexts.prefix) {\n+ promises = {\n+ ...promises,\n+ prefix: resolveToString(unresolvedNotifTexts.prefix),\n+ };\n+ }\n+ return await promiseAll(promises);\n}\nfunction strippedRobotextForMessageInfo(\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/types/notif-types.js",
"new_path": "lib/types/notif-types.js",
"diff": "// @flow\n+import type { EntityText } from '../utils/entity-text';\n+\nexport type NotifTexts = {\n+ +merged: string | EntityText,\n+ +body: string | EntityText,\n+ +title: string | EntityText,\n+ +prefix?: string | EntityText,\n+};\n+\n+export type ResolvedNotifTexts = {\n+merged: string,\n+body: string,\n+title: string,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib][keyserver] Allow notificationTexts to render EntityText
Summary:
This diff adds support to `keyserver` for resolving `EntityText` returned by a message spec's `notificationTexts` function.
Depends on D6573
Test Plan: Tested in combination with later notif diffs
Reviewers: atul, ginsu, michal, marcin
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6574 |
129,187 | 04.02.2023 00:56:35 | 18,000 | 738aa93507fcf028f3f5e0cc194c4e163292f0ef | [lib] Stop passing notifThreadName to notificationTexts
Summary:
This is no longer necessary, as the same functionality is handled through the `EntityText` framework.
Depends on D6584
Test Plan: Flow
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "lib/shared/messages/message-spec.js",
"new_path": "lib/shared/messages/message-spec.js",
"diff": "@@ -44,7 +44,6 @@ export type RobotextParams = {\n};\nexport type NotificationTextsParams = {\n- +notifThreadName: (threadInfo: ThreadInfo) => string,\n+notificationTexts: (\nmessageInfos: $ReadOnlyArray<MessageInfo>,\nthreadInfo: ThreadInfo,\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/shared/notif-utils.js",
"new_path": "lib/shared/notif-utils.js",
"diff": "@@ -129,14 +129,6 @@ function notifTextsForSubthreadCreation(\n};\n}\n-function notifThreadName(threadInfo: ThreadInfo): string {\n- if (threadInfo.name) {\n- return threadInfo.name;\n- } else {\n- return 'your chat';\n- }\n-}\n-\nfunction mostRecentMessageInfoType(\nmessageInfos: $ReadOnlyArray<MessageInfo>,\n): MessageType {\n@@ -169,10 +161,7 @@ async function fullNotifTextsForMessageInfo(\nconst unresolvedNotifTexts = await messageSpec.notificationTexts(\nmessageInfos,\nthreadInfo,\n- {\n- notifThreadName,\n- notificationTexts: innerNotificationTexts,\n- },\n+ { notificationTexts: innerNotificationTexts },\n);\nconst resolveToString = async (\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Stop passing notifThreadName to notificationTexts
Summary:
This is no longer necessary, as the same functionality is handled through the `EntityText` framework.
Depends on D6584
Test Plan: Flow
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6585 |
129,187 | 04.02.2023 13:59:54 | 18,000 | 5d0ad3f5a29d0a32cf0ecf504b1ed43bda3540a0 | [lib] Make FilterThreadInfo $ReadOnly
Summary: Depends on D6588
Test Plan: Flow
Reviewers: atul, inka
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "lib/selectors/calendar-selectors.js",
"new_path": "lib/selectors/calendar-selectors.js",
"diff": "@@ -33,7 +33,10 @@ function useFilterThreadInfos(\ncontinue;\n}\nif (result[threadID]) {\n- result[threadID].numVisibleEntries++;\n+ result[threadID] = {\n+ ...result[threadID],\n+ numVisibleEntries: result[threadID].numVisibleEntries + 1,\n+ };\n} else {\nresult[threadID] = {\nthreadInfo,\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/types/filter-types.js",
"new_path": "lib/types/filter-types.js",
"diff": "@@ -29,6 +29,6 @@ export type SetCalendarDeletedFilterPayload = {\n};\nexport type FilterThreadInfo = {\n- threadInfo: ThreadInfo,\n- numVisibleEntries: number,\n+ +threadInfo: ThreadInfo,\n+ +numVisibleEntries: number,\n};\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Make FilterThreadInfo $ReadOnly
Summary: Depends on D6588
Test Plan: Flow
Reviewers: atul, inka
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6589 |
129,187 | 04.02.2023 14:40:17 | 18,000 | 44e05982b7fe567ec49b04627c5510d0aaacf8af | [lib] Don't pass threadID in twice to getNameForThreadEntity
Summary:
This is already being passed in via `params`. This diff should be a no-op... just simplifying the code.
Depends on D6589
Test Plan: Flow, play around with app, tested in combination with following diffs
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "lib/utils/entity-text.js",
"new_path": "lib/utils/entity-text.js",
"diff": "@@ -213,7 +213,6 @@ function makePossessive(input: MakePossessiveInput) {\nfunction getNameForThreadEntity(\nentity: ThreadEntity,\n- threadID: ?string,\nparams?: ?EntityTextToRawStringParams,\n): string {\nconst { name: userGeneratedName, display } = entity;\n@@ -243,7 +242,7 @@ function getNameForThreadEntity(\nif (!name || entity.alwaysDisplayShortName) {\nconst threadType = entity.threadType ?? threadTypes.PERSONAL;\nconst noun = entity.subchannel ? 'subchannel' : threadNoun(threadType);\n- if (entity.id === threadID) {\n+ if (entity.id === params?.threadID) {\nconst prefixThisThreadNounWith =\nparams?.prefixThisThreadNounWith === 'your' ? 'your' : 'this';\nname = `${prefixThisThreadNounWith} ${noun}`;\n@@ -283,7 +282,7 @@ function entityTextToRawString(\nif (typeof entity === 'string') {\nreturn entity;\n} else if (entity.type === 'thread') {\n- return getNameForThreadEntity(entity, params?.threadID, params);\n+ return getNameForThreadEntity(entity, params);\n} else if (entity.type === 'color') {\nreturn entity.hex;\n} else if (entity.type === 'user') {\n@@ -319,7 +318,7 @@ function entityTextToReact(\n);\n} else if (entity.type === 'thread') {\nconst { id } = entity;\n- const name = getNameForThreadEntity(entity, threadID);\n+ const name = getNameForThreadEntity(entity, { threadID });\nif (id === threadID) {\nreturn name;\n} else {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Don't pass threadID in twice to getNameForThreadEntity
Summary:
This is already being passed in via `params`. This diff should be a no-op... just simplifying the code.
Depends on D6589
Test Plan: Flow, play around with app, tested in combination with following diffs
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6590 |
129,187 | 04.02.2023 20:27:50 | 18,000 | d085ffb7022efc111741c977b36ed8985f9bf1f7 | [native] Fetch ENS names for ThreadInfo uiName in Entry
Summary: Depends on D6592
Test Plan: | {F363526} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/calendar/entry.react.js",
"new_path": "native/calendar/entry.react.js",
"diff": "@@ -44,13 +44,18 @@ import type {\n} from 'lib/types/entry-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { Dispatch } from 'lib/types/redux-types';\n-import { type ThreadInfo, threadPermissions } from 'lib/types/thread-types';\n+import {\n+ type ThreadInfo,\n+ type ResolvedThreadInfo,\n+ threadPermissions,\n+} from 'lib/types/thread-types';\nimport {\nuseServerCall,\nuseDispatchActionPromise,\ntype DispatchActionPromise,\n} from 'lib/utils/action-utils';\nimport { dateString } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { ServerError } from 'lib/utils/errors';\nimport sleep from 'lib/utils/sleep';\n@@ -96,10 +101,9 @@ function dummyNodeForEntryHeightMeasurement(\n);\n}\n-type BaseProps = {\n+type SharedProps = {\n+navigation: TabNavigationProp<'Calendar'>,\n+entryInfo: EntryInfoWithHeight,\n- +threadInfo: ThreadInfo,\n+visible: boolean,\n+active: boolean,\n+makeActive: (entryKey: string, active: boolean) => void,\n@@ -108,8 +112,13 @@ type BaseProps = {\n+onPressWhitespace: () => void,\n+entryRef: (entryKey: string, entry: ?InternalEntry) => void,\n};\n+type BaseProps = {\n+ ...SharedProps,\n+ +threadInfo: ThreadInfo,\n+};\ntype Props = {\n- ...BaseProps,\n+ ...SharedProps,\n+ +threadInfo: ResolvedThreadInfo,\n// Redux state\n+calendarQuery: () => CalendarQuery,\n+online: boolean,\n@@ -787,9 +796,12 @@ const Entry: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nconst callSaveEntry = useServerCall(saveEntry);\nconst callDeleteEntry = useServerCall(deleteEntry);\n+ const { threadInfo: unresolvedThreadInfo, ...restProps } = props;\n+ const threadInfo = useResolvedThreadInfo(unresolvedThreadInfo);\n+\nreturn (\n<InternalEntry\n- {...props}\n+ {...restProps}\nthreadPickerActive={threadPickerActive}\ncalendarQuery={calendarQuery}\nonline={online}\n@@ -800,6 +812,7 @@ const Entry: React.ComponentType<BaseProps> = React.memo<BaseProps>(\ncreateEntry={callCreateEntry}\nsaveEntry={callSaveEntry}\ndeleteEntry={callDeleteEntry}\n+ threadInfo={threadInfo}\n/>\n);\n},\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names for ThreadInfo uiName in Entry
Summary: Depends on D6592
Test Plan: | {F363526} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6593 |
129,187 | 04.02.2023 20:28:03 | 18,000 | ce28b6c2c87ca34971a7fe22517ff8e2758bb5d2 | [native] Fetch ENS names in ChatThreadListItem
Summary: Depends on D6593
Test Plan: | {F363530} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-thread-list-item.react.js",
"new_path": "native/chat/chat-thread-list-item.react.js",
"diff": "@@ -7,6 +7,7 @@ import type { ChatThreadItem } from 'lib/selectors/chat-selectors';\nimport type { ThreadInfo } from 'lib/types/thread-types';\nimport type { UserInfo } from 'lib/types/user-types';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../components/button.react';\nimport ColorSplotch from '../components/color-splotch.react';\n@@ -114,6 +115,8 @@ function ChatThreadListItem({\nstyles.unreadLastActivity,\n]);\n+ const resolvedThreadInfo = useResolvedThreadInfo(data.threadInfo);\n+\nreturn (\n<>\n<SwipeableThread\n@@ -141,7 +144,7 @@ function ChatThreadListItem({\n<ThreadAncestorsLabel threadInfo={data.threadInfo} />\n<View style={styles.row}>\n<SingleLine style={threadNameStyle}>\n- {data.threadInfo.uiName}\n+ {resolvedThreadInfo.uiName}\n</SingleLine>\n</View>\n<View style={styles.row}>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in ChatThreadListItem
Summary: Depends on D6593
Test Plan: | {F363530} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6594 |
129,187 | 04.02.2023 20:28:16 | 18,000 | 2350c4ec337343ccab6eae19ab6cee16a653d0a7 | [native] Move DeleteThread logic for determining ThreadInfo to hook
Summary:
This mirrors the same migration that we did for this logic in `ThreadSettings`.
Depends on D6594
Test Plan: Flow, code inspection / comparison to `ThreadSettings` code. Also tested in combination with following diffs
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/chat/settings/delete-thread.react.js",
"new_path": "native/chat/settings/delete-thread.react.js",
"diff": "@@ -49,7 +49,7 @@ type BaseProps = {\ntype Props = {\n...BaseProps,\n// Redux state\n- +threadInfo: ?ThreadInfo,\n+ +threadInfo: ThreadInfo,\n+loadingStatus: LoadingStatus,\n+activeTheme: ?GlobalTheme,\n+colors: Colors,\n@@ -65,14 +65,6 @@ class DeleteThread extends React.PureComponent<Props> {\nmounted = false;\npasswordInput: ?React.ElementRef<typeof BaseTextInput>;\n- static getThreadInfo(props: Props): ThreadInfo {\n- const { threadInfo } = props;\n- if (threadInfo) {\n- return threadInfo;\n- }\n- return props.route.params.threadInfo;\n- }\n-\ncomponentDidMount() {\nthis.mounted = true;\n}\n@@ -87,14 +79,6 @@ class DeleteThread extends React.PureComponent<Props> {\n}\n}\n- componentDidUpdate(prevProps: Props) {\n- const oldReduxThreadInfo = prevProps.threadInfo;\n- const newReduxThreadInfo = this.props.threadInfo;\n- if (newReduxThreadInfo && newReduxThreadInfo !== oldReduxThreadInfo) {\n- this.props.navigation.setParams({ threadInfo: newReduxThreadInfo });\n- }\n- }\n-\nrender() {\nconst buttonContent =\nthis.props.loadingStatus === 'loading' ? (\n@@ -102,7 +86,7 @@ class DeleteThread extends React.PureComponent<Props> {\n) : (\n<Text style={this.props.styles.deleteText}>Delete chat</Text>\n);\n- const threadInfo = DeleteThread.getThreadInfo(this.props);\n+ const { threadInfo } = this.props;\nreturn (\n<ScrollView\ncontentContainerStyle={this.props.styles.scrollViewContentContainer}\n@@ -143,8 +127,7 @@ class DeleteThread extends React.PureComponent<Props> {\n};\nasync deleteThread() {\n- const threadInfo = DeleteThread.getThreadInfo(this.props);\n- const { navDispatch } = this.props;\n+ const { threadInfo, navDispatch } = this.props;\nnavDispatch({\ntype: clearThreadsActionType,\npayload: { threadIDs: [threadInfo.id] },\n@@ -238,10 +221,19 @@ const loadingStatusSelector = createLoadingStatusSelector(\nconst ConnectedDeleteThread: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedDeleteThread(props: BaseProps) {\nconst threadID = props.route.params.threadInfo.id;\n- const threadInfo = useSelector(\n+ const reduxThreadInfo = useSelector(\nstate => threadInfoSelector(state)[threadID],\n);\n+ const { setParams } = props.navigation;\n+ React.useEffect(() => {\n+ if (reduxThreadInfo) {\n+ setParams({ threadInfo: reduxThreadInfo });\n+ }\n+ }, [reduxThreadInfo, setParams]);\n+ const threadInfo: ThreadInfo =\n+ reduxThreadInfo ?? props.route.params.threadInfo;\n+\nconst loadingStatus = useSelector(loadingStatusSelector);\nconst activeTheme = useSelector(state => state.globalThemeInfo.activeTheme);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Move DeleteThread logic for determining ThreadInfo to hook
Summary:
This mirrors the same migration that we did for this logic in `ThreadSettings`.
Depends on D6594
Test Plan: Flow, code inspection / comparison to `ThreadSettings` code. Also tested in combination with following diffs
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6595 |
129,187 | 04.02.2023 20:28:30 | 18,000 | c7168d411bbfd4904a4e2f81471e2bc353a85b41 | [native] Fetch ENS names in ThreadSettings
Summary: Depends on D6595
Test Plan: | {F363538} | {F363539} | {F363540} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "lib/utils/entity-helpers.js",
"new_path": "lib/utils/entity-helpers.js",
"diff": "@@ -44,6 +44,41 @@ function useResolvedThreadInfos(\n);\n}\n+function useResolvedOptionalThreadInfos(\n+ threadInfos: ?$ReadOnlyArray<ThreadInfo>,\n+): ?$ReadOnlyArray<ResolvedThreadInfo> {\n+ const entityText = React.useMemo(() => {\n+ if (!threadInfos) {\n+ return null;\n+ }\n+ return threadInfos.map(threadInfo =>\n+ ET.thread({ display: 'uiName', threadInfo }),\n+ );\n+ }, [threadInfos]);\n+ const withENSNames = useENSNamesForEntityText(entityText);\n+ return React.useMemo(() => {\n+ if (!threadInfos) {\n+ return threadInfos;\n+ }\n+ invariant(\n+ withENSNames,\n+ 'useENSNamesForEntityText only returns falsey when passed falsey',\n+ );\n+ return threadInfos.map((threadInfo, i) => {\n+ if (typeof threadInfo.uiName === 'string') {\n+ // Flow wants return { ...threadInfo, uiName: threadInfo.uiName }\n+ // but that's wasteful and unneeded, so we any-cast here\n+ return (threadInfo: any);\n+ }\n+ const resolvedThreadEntity = withENSNames[i];\n+ return {\n+ ...threadInfo,\n+ uiName: entityTextToRawString([resolvedThreadEntity]),\n+ };\n+ });\n+ }, [threadInfos, withENSNames]);\n+}\n+\nfunction useResolvedThreadInfosObj(threadInfosObj: {\n+[id: string]: ThreadInfo,\n}): { +[id: string]: ResolvedThreadInfo } {\n@@ -66,8 +101,24 @@ function useResolvedThreadInfo(threadInfo: ThreadInfo): ResolvedThreadInfo {\nreturn resolvedThreadInfo;\n}\n+function useResolvedOptionalThreadInfo(\n+ threadInfo: ?ThreadInfo,\n+): ?ResolvedThreadInfo {\n+ const resolutionInput = React.useMemo(\n+ () => (threadInfo ? [threadInfo] : []),\n+ [threadInfo],\n+ );\n+ const [resolvedThreadInfo] = useResolvedThreadInfos(resolutionInput);\n+ if (!threadInfo) {\n+ return threadInfo;\n+ }\n+ return resolvedThreadInfo;\n+}\n+\nexport {\nuseResolvedThreadInfos,\n+ useResolvedOptionalThreadInfos,\nuseResolvedThreadInfosObj,\nuseResolvedThreadInfo,\n+ useResolvedOptionalThreadInfo,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/settings/delete-thread.react.js",
"new_path": "native/chat/settings/delete-thread.react.js",
"diff": "@@ -19,12 +19,17 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport { threadInfoSelector } from 'lib/selectors/thread-selectors';\nimport { identifyInvalidatedThreads } from 'lib/shared/thread-utils';\nimport type { LoadingStatus } from 'lib/types/loading-types';\n-import type { ThreadInfo, LeaveThreadPayload } from 'lib/types/thread-types';\n+import type {\n+ ThreadInfo,\n+ ResolvedThreadInfo,\n+ LeaveThreadPayload,\n+} from 'lib/types/thread-types';\nimport {\nuseServerCall,\nuseDispatchActionPromise,\ntype DispatchActionPromise,\n} from 'lib/utils/action-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../../components/button.react';\nimport { clearThreadsActionType } from '../../navigation/action-types';\n@@ -49,7 +54,7 @@ type BaseProps = {\ntype Props = {\n...BaseProps,\n// Redux state\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+loadingStatus: LoadingStatus,\n+activeTheme: ?GlobalTheme,\n+colors: Colors,\n@@ -231,8 +236,8 @@ const ConnectedDeleteThread: React.ComponentType<BaseProps> = React.memo<BasePro\nsetParams({ threadInfo: reduxThreadInfo });\n}\n}, [reduxThreadInfo, setParams]);\n- const threadInfo: ThreadInfo =\n- reduxThreadInfo ?? props.route.params.threadInfo;\n+ const threadInfo = reduxThreadInfo ?? props.route.params.threadInfo;\n+ const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);\nconst loadingStatus = useSelector(loadingStatusSelector);\nconst activeTheme = useSelector(state => state.globalThemeInfo.activeTheme);\n@@ -250,7 +255,7 @@ const ConnectedDeleteThread: React.ComponentType<BaseProps> = React.memo<BasePro\nreturn (\n<DeleteThread\n{...props}\n- threadInfo={threadInfo}\n+ threadInfo={resolvedThreadInfo}\nloadingStatus={loadingStatus}\nactiveTheme={activeTheme}\ncolors={colors}\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/settings/thread-settings-delete-thread.react.js",
"new_path": "native/chat/settings/thread-settings-delete-thread.react.js",
"diff": "import * as React from 'react';\nimport { Text, View } from 'react-native';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n+import type { ResolvedThreadInfo } from 'lib/types/thread-types';\nimport Button from '../../components/button.react';\nimport { DeleteThreadRouteName } from '../../navigation/route-names';\n@@ -12,7 +12,7 @@ import type { ViewStyle } from '../../types/styles';\nimport type { ThreadSettingsNavigate } from './thread-settings.react';\ntype Props = {\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+navigate: ThreadSettingsNavigate,\n+buttonStyle: ViewStyle,\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/settings/thread-settings-name.react.js",
"new_path": "native/chat/settings/thread-settings-name.react.js",
"diff": "@@ -17,7 +17,7 @@ import {\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport {\n- type ThreadInfo,\n+ type ResolvedThreadInfo,\ntype ChangeThreadSettingsPayload,\ntype UpdateThreadRequest,\n} from 'lib/types/thread-types';\n@@ -36,7 +36,7 @@ import { type Colors, useStyles, useColors } from '../../themes/colors';\nimport SaveSettingButton from './save-setting-button.react';\ntype BaseProps = {\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+nameEditValue: ?string,\n+setNameEditValue: (value: ?string, callback?: () => void) => void,\n+canChangeSettings: boolean,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/settings/thread-settings.react.js",
"new_path": "native/chat/settings/thread-settings.react.js",
"diff": "@@ -31,11 +31,17 @@ import threadWatcher from 'lib/shared/thread-watcher';\nimport type { RelationshipButton } from 'lib/types/relationship-types';\nimport {\ntype ThreadInfo,\n+ type ResolvedThreadInfo,\ntype RelativeMemberInfo,\nthreadPermissions,\nthreadTypes,\n} from 'lib/types/thread-types';\nimport type { UserInfos } from 'lib/types/user-types';\n+import {\n+ useResolvedThreadInfo,\n+ useResolvedOptionalThreadInfo,\n+ useResolvedOptionalThreadInfos,\n+} from 'lib/utils/entity-helpers';\nimport ThreadAncestors from '../../components/thread-ancestors.react';\nimport {\n@@ -113,14 +119,14 @@ type ChatSettingsItem =\n| {\n+itemType: 'name',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+nameEditValue: ?string,\n+canChangeSettings: boolean,\n}\n| {\n+itemType: 'color',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+colorEditValue: string,\n+canChangeSettings: boolean,\n+navigate: ThreadSettingsNavigate,\n@@ -129,7 +135,7 @@ type ChatSettingsItem =\n| {\n+itemType: 'description',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+descriptionEditValue: ?string,\n+descriptionTextHeight: ?number,\n+canChangeSettings: boolean,\n@@ -137,23 +143,23 @@ type ChatSettingsItem =\n| {\n+itemType: 'parent',\n+key: string,\n- +threadInfo: ThreadInfo,\n- +parentThreadInfo: ?ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+ +parentThreadInfo: ?ResolvedThreadInfo,\n}\n| {\n+itemType: 'visibility',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n}\n| {\n+itemType: 'pushNotifs',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n}\n| {\n+itemType: 'homeNotifs',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n}\n| {\n+itemType: 'seeMore',\n@@ -163,7 +169,7 @@ type ChatSettingsItem =\n| {\n+itemType: 'childThread',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+firstListItem: boolean,\n+lastListItem: boolean,\n}\n@@ -175,7 +181,7 @@ type ChatSettingsItem =\n+itemType: 'member',\n+key: string,\n+memberInfo: RelativeMemberInfo,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+canEdit: boolean,\n+navigate: ThreadSettingsNavigate,\n+firstListItem: boolean,\n@@ -190,14 +196,14 @@ type ChatSettingsItem =\n| {\n+itemType: 'promoteSidebar' | 'leaveThread' | 'deleteThread',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+navigate: ThreadSettingsNavigate,\n+buttonStyle: ViewStyle,\n}\n| {\n+itemType: 'editRelationship',\n+key: string,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+navigate: ThreadSettingsNavigate,\n+buttonStyle: ViewStyle,\n+relationshipButton: RelationshipButton,\n@@ -212,9 +218,9 @@ type Props = {\n// Redux state\n+userInfos: UserInfos,\n+viewerID: ?string,\n- +threadInfo: ThreadInfo,\n- +parentThreadInfo: ?ThreadInfo,\n- +childThreadInfos: ?$ReadOnlyArray<ThreadInfo>,\n+ +threadInfo: ResolvedThreadInfo,\n+ +parentThreadInfo: ?ResolvedThreadInfo,\n+ +childThreadInfos: ?$ReadOnlyArray<ResolvedThreadInfo>,\n+somethingIsSaving: boolean,\n+styles: typeof unboundStyles,\n+indicatorStyle: IndicatorStyle,\n@@ -291,8 +297,8 @@ class ThreadSettings extends React.PureComponent<Props, State> {\n(propsAndState: PropsAndState) => propsAndState.navigation.navigate,\n(propsAndState: PropsAndState) => propsAndState.route.key,\n(\n- threadInfo: ThreadInfo,\n- parentThreadInfo: ?ThreadInfo,\n+ threadInfo: ResolvedThreadInfo,\n+ parentThreadInfo: ?ResolvedThreadInfo,\nnameEditValue: ?string,\ncolorEditValue: string,\ndescriptionEditValue: ?string,\n@@ -420,9 +426,9 @@ class ThreadSettings extends React.PureComponent<Props, State> {\n(propsAndState: PropsAndState) => propsAndState.childThreadInfos,\n(propsAndState: PropsAndState) => propsAndState.numSubchannelsShowing,\n(\n- threadInfo: ThreadInfo,\n+ threadInfo: ResolvedThreadInfo,\nnavigate: ThreadSettingsNavigate,\n- childThreads: ?$ReadOnlyArray<ThreadInfo>,\n+ childThreads: ?$ReadOnlyArray<ResolvedThreadInfo>,\nnumSubchannelsShowing: number,\n) => {\nconst listData: ChatSettingsItem[] = [];\n@@ -486,7 +492,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\n(propsAndState: PropsAndState) => propsAndState.numSidebarsShowing,\n(\nnavigate: ThreadSettingsNavigate,\n- childThreads: ?$ReadOnlyArray<ThreadInfo>,\n+ childThreads: ?$ReadOnlyArray<ResolvedThreadInfo>,\nnumSidebarsShowing: number,\n) => {\nconst listData: ChatSettingsItem[] = [];\n@@ -544,7 +550,7 @@ class ThreadSettings extends React.PureComponent<Props, State> {\n(propsAndState: PropsAndState) => propsAndState.numMembersShowing,\n(propsAndState: PropsAndState) => propsAndState.verticalBounds,\n(\n- threadInfo: ThreadInfo,\n+ threadInfo: ResolvedThreadInfo,\ncanStartEditing: boolean,\nnavigate: ThreadSettingsNavigate,\nrouteKey: string,\n@@ -619,8 +625,8 @@ class ThreadSettings extends React.PureComponent<Props, State> {\n(propsAndState: PropsAndState) => propsAndState.userInfos,\n(propsAndState: PropsAndState) => propsAndState.viewerID,\n(\n- threadInfo: ThreadInfo,\n- parentThreadInfo: ?ThreadInfo,\n+ threadInfo: ResolvedThreadInfo,\n+ parentThreadInfo: ?ResolvedThreadInfo,\nnavigate: ThreadSettingsNavigate,\nstyles: typeof unboundStyles,\nuserInfos: UserInfos,\n@@ -1060,6 +1066,7 @@ const ConnectedThreadSettings: React.ComponentType<BaseProps> = React.memo<BaseP\n}, [reduxThreadInfo, setParams]);\nconst threadInfo: ThreadInfo =\nreduxThreadInfo ?? props.route.params.threadInfo;\n+ const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);\nReact.useEffect(() => {\nif (threadInChatList(threadInfo)) {\n@@ -1075,10 +1082,16 @@ const ConnectedThreadSettings: React.ComponentType<BaseProps> = React.memo<BaseP\nconst parentThreadInfo: ?ThreadInfo = useSelector(state =>\nparentThreadID ? threadInfoSelector(state)[parentThreadID] : null,\n);\n+ const resolvedParentThreadInfo = useResolvedOptionalThreadInfo(\n+ parentThreadInfo,\n+ );\nconst threadMembers = threadInfo.members;\nconst boundChildThreadInfos = useSelector(\nstate => childThreadInfos(state)[threadID],\n);\n+ const resolvedChildThreadInfos = useResolvedOptionalThreadInfos(\n+ boundChildThreadInfos,\n+ );\nconst boundSomethingIsSaving = useSelector(state =>\nsomethingIsSaving(state, threadMembers),\n);\n@@ -1108,9 +1121,9 @@ const ConnectedThreadSettings: React.ComponentType<BaseProps> = React.memo<BaseP\n{...props}\nuserInfos={userInfos}\nviewerID={viewerID}\n- threadInfo={threadInfo}\n- parentThreadInfo={parentThreadInfo}\n- childThreadInfos={boundChildThreadInfos}\n+ threadInfo={resolvedThreadInfo}\n+ parentThreadInfo={resolvedParentThreadInfo}\n+ childThreadInfos={resolvedChildThreadInfos}\nsomethingIsSaving={boundSomethingIsSaving}\nstyles={styles}\nindicatorStyle={indicatorStyle}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in ThreadSettings
Summary: Depends on D6595
Test Plan: | {F363538} | {F363539} | {F363540} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6596 |
129,187 | 04.02.2023 20:28:46 | 18,000 | c2741d65e569e532ad54a1850cfeeb3b6e6617f1 | [native] Fetch ENS names in MessageListHeaderTitle
Summary: Depends on D6596
Test Plan: | {F363544} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list-header-title.react.js",
"new_path": "native/chat/message-list-header-title.react.js",
"diff": "@@ -9,6 +9,7 @@ import * as React from 'react';\nimport { View, Platform } from 'react-native';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { firstLine } from 'lib/utils/string-utils';\nimport Button from '../components/button.react';\n@@ -26,6 +27,7 @@ type BaseProps = {\ntype Props = {\n...BaseProps,\n+styles: typeof unboundStyles,\n+ +title: string,\n};\nclass MessageListHeaderTitle extends React.PureComponent<Props> {\nrender() {\n@@ -35,6 +37,7 @@ class MessageListHeaderTitle extends React.PureComponent<Props> {\nisSearchEmpty,\nareSettingsEnabled,\nstyles,\n+ title,\n...rest\n} = this.props;\n@@ -48,8 +51,6 @@ class MessageListHeaderTitle extends React.PureComponent<Props> {\n);\n}\n- const title = isSearchEmpty ? 'New Message' : threadInfo.uiName;\n-\nreturn (\n<Button\nonPress={this.onPress}\n@@ -67,7 +68,7 @@ class MessageListHeaderTitle extends React.PureComponent<Props> {\n}\nonPress = () => {\n- const threadInfo = this.props.threadInfo;\n+ const { threadInfo } = this.props;\nthis.props.navigate<'ThreadSettings'>({\nname: ThreadSettingsRouteName,\nparams: { threadInfo },\n@@ -106,7 +107,11 @@ const ConnectedMessageListHeaderTitle: React.ComponentType<BaseProps> = React.me\nfunction ConnectedMessageListHeaderTitle(props: BaseProps) {\nconst styles = useStyles(unboundStyles);\n- return <MessageListHeaderTitle {...props} styles={styles} />;\n+ const { uiName } = useResolvedThreadInfo(props.threadInfo);\n+ const { isSearchEmpty } = props;\n+ const title = isSearchEmpty ? 'New Message' : uiName;\n+\n+ return <MessageListHeaderTitle {...props} styles={styles} title={title} />;\n},\n);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in MessageListHeaderTitle
Summary: Depends on D6596
Test Plan: | {F363544} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6597 |
129,187 | 04.02.2023 20:29:50 | 18,000 | 614bc59d88cf8e6b6b011fd9a727b40dc3ee3665 | [native] Introduce ThreadSettingsHeaderTitle for fetching ENS names
Summary: Depends on D6597
Test Plan: | {F363546} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat.react.js",
"new_path": "native/chat/chat.react.js",
"diff": "@@ -29,7 +29,6 @@ import {\nthreadIsPending,\nthreadMembersWithoutAddedAshoat,\n} from 'lib/shared/thread-utils';\n-import { firstLine } from 'lib/utils/string-utils';\nimport KeyboardAvoidingView from '../components/keyboard-avoiding-view.react';\nimport SWMansionIcon from '../components/swmansion-icon.react';\n@@ -64,6 +63,7 @@ import DeleteThread from './settings/delete-thread.react';\nimport ThreadSettings from './settings/thread-settings.react';\nimport ThreadScreenPruner from './thread-screen-pruner.react';\nimport ThreadSettingsButton from './thread-settings-button.react';\n+import ThreadSettingsHeaderTitle from './thread-settings-header-title.react';\nconst unboundStyles = {\nkeyboardAvoidingView: {\n@@ -240,7 +240,13 @@ const composeThreadOptions = {\nheaderBackTitleVisible: false,\n};\nconst threadSettingsOptions = ({ route }) => ({\n- headerTitle: firstLine(route.params.threadInfo.uiName),\n+ // eslint-disable-next-line react/display-name\n+ headerTitle: props => (\n+ <ThreadSettingsHeaderTitle\n+ threadInfo={route.params.threadInfo}\n+ {...props}\n+ />\n+ ),\nheaderBackTitleVisible: false,\n});\nconst deleteThreadOptions = {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "native/chat/thread-settings-header-title.react.js",
"diff": "+// @flow\n+\n+import {\n+ HeaderTitle,\n+ type HeaderTitleInputProps,\n+} from '@react-navigation/elements';\n+import * as React from 'react';\n+\n+import type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\n+import { firstLine } from 'lib/utils/string-utils';\n+\n+type Props = {\n+ +threadInfo: ThreadInfo,\n+ ...HeaderTitleInputProps,\n+};\n+function ThreadSettingsHeaderTitle(props: Props): React.Node {\n+ const { threadInfo, ...rest } = props;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\n+ return <HeaderTitle {...rest}>{firstLine(uiName)}</HeaderTitle>;\n+}\n+\n+const MemoizedThreadSettingsHeaderTitle: React.ComponentType<Props> = React.memo<Props>(\n+ ThreadSettingsHeaderTitle,\n+);\n+\n+export default MemoizedThreadSettingsHeaderTitle;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Introduce ThreadSettingsHeaderTitle for fetching ENS names
Summary: Depends on D6597
Test Plan: | {F363546} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6598 |
129,187 | 04.02.2023 20:30:06 | 18,000 | e008c1d8a0155f4ce3a87eebb3fe874c54f5cde8 | [native] Fetch ENS names in SidebarItem/SubchannelItem
Summary: Depends on D6598
Test Plan: | {F363561} | {F363562} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/chat/sidebar-item.react.js",
"new_path": "native/chat/sidebar-item.react.js",
"diff": "@@ -5,6 +5,7 @@ import { Text, View } from 'react-native';\nimport type { SidebarInfo } from 'lib/types/thread-types';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { SingleLine } from '../components/single-line.react';\nimport { useStyles } from '../themes/colors';\n@@ -17,14 +18,13 @@ function SidebarItem(props: Props): React.Node {\nconst lastActivity = shortAbsoluteDate(lastUpdatedTime);\nconst { threadInfo } = props.sidebarInfo;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nconst styles = useStyles(unboundStyles);\nconst unreadStyle = threadInfo.currentUser.unread ? styles.unread : null;\nreturn (\n<View style={styles.itemContainer}>\n- <SingleLine style={[styles.name, unreadStyle]}>\n- {threadInfo.uiName}\n- </SingleLine>\n+ <SingleLine style={[styles.name, unreadStyle]}>{uiName}</SingleLine>\n<Text style={[styles.lastActivity, unreadStyle]}>{lastActivity}</Text>\n</View>\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/subchannel-item.react.js",
"new_path": "native/chat/subchannel-item.react.js",
"diff": "@@ -5,6 +5,7 @@ import { Text, View } from 'react-native';\nimport type { ChatThreadItem } from 'lib/selectors/chat-selectors';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { SingleLine } from '../components/single-line.react';\nimport SWMansionIcon from '../components/swmansion-icon.react';\n@@ -20,6 +21,7 @@ function SubchannelItem(props: Props): React.Node {\nthreadInfo,\nmostRecentMessageInfo,\n} = props.subchannelInfo;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nconst lastActivity = shortAbsoluteDate(lastUpdatedTime);\n@@ -51,9 +53,7 @@ function SubchannelItem(props: Props): React.Node {\nstyle={[styles.icon, unreadStyle]}\n/>\n</View>\n- <SingleLine style={[styles.name, unreadStyle]}>\n- {threadInfo.uiName}\n- </SingleLine>\n+ <SingleLine style={[styles.name, unreadStyle]}>{uiName}</SingleLine>\n</View>\n<View style={styles.itemRowContainer}>\n{lastMessage}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in SidebarItem/SubchannelItem
Summary: Depends on D6598
Test Plan: | {F363561} | {F363562} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6599 |
129,187 | 04.02.2023 20:30:20 | 18,000 | af8e1ef3d74eeb41617135e76d0270fe4e77ea65 | [native] Fetch ENS names in ThreadAncestorsLabel
Summary: Depends on D6599
Test Plan: | {F363566} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/components/thread-ancestors-label.react.js",
"new_path": "native/components/thread-ancestors-label.react.js",
"diff": "@@ -6,6 +6,7 @@ import { Text, View } from 'react-native';\nimport { useAncestorThreads } from 'lib/shared/ancestor-threads';\nimport { type ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfos } from 'lib/utils/entity-helpers';\nimport { useColors, useStyles } from '../themes/colors';\n@@ -18,6 +19,7 @@ function ThreadAncestorsLabel(props: Props): React.Node {\nconst styles = useStyles(unboundStyles);\nconst colors = useColors();\nconst ancestorThreads = useAncestorThreads(threadInfo);\n+ const resolvedAncestorThreads = useResolvedThreadInfos(ancestorThreads);\nconst chevronIcon = React.useMemo(\n() => (\n@@ -32,7 +34,7 @@ function ThreadAncestorsLabel(props: Props): React.Node {\nconst ancestorPath = React.useMemo(() => {\nconst path = [];\n- for (const thread of ancestorThreads) {\n+ for (const thread of resolvedAncestorThreads) {\npath.push(<Text key={thread.id}>{thread.uiName}</Text>);\npath.push(\n<View key={`>${thread.id}`} style={styles.chevron}>\n@@ -42,7 +44,7 @@ function ThreadAncestorsLabel(props: Props): React.Node {\n}\npath.pop();\nreturn path;\n- }, [ancestorThreads, chevronIcon, styles.chevron]);\n+ }, [resolvedAncestorThreads, chevronIcon, styles.chevron]);\nconst ancestorPathStyle = React.useMemo(() => {\nreturn unread ? [styles.pathText, styles.unread] : styles.pathText;\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in ThreadAncestorsLabel
Summary: Depends on D6599
Test Plan: | {F363566} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6600 |
129,187 | 04.02.2023 20:30:34 | 18,000 | 9feae96a6a64bee5db27f990a8467c6f12e08122 | [native] Fetch ENS names in ThreadListThread
Summary: Depends on D6600
Test Plan: | {F363571} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/components/thread-list-thread.react.js",
"new_path": "native/components/thread-list-thread.react.js",
"diff": "import * as React from 'react';\n-import { type ThreadInfo } from 'lib/types/thread-types';\n+import type { ThreadInfo, ResolvedThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { type Colors, useStyles, useColors } from '../themes/colors';\nimport type { ViewStyle, TextStyle } from '../types/styles';\n@@ -10,14 +11,18 @@ import Button from './button.react';\nimport ColorSplotch from './color-splotch.react';\nimport { SingleLine } from './single-line.react';\n-type BaseProps = {\n- +threadInfo: ThreadInfo,\n+type SharedProps = {\n+onSelect: (threadID: string) => void,\n+style?: ViewStyle,\n+textStyle?: TextStyle,\n};\n+type BaseProps = {\n+ ...SharedProps,\n+ +threadInfo: ThreadInfo,\n+};\ntype Props = {\n- ...BaseProps,\n+ ...SharedProps,\n+ +threadInfo: ResolvedThreadInfo,\n+colors: Colors,\n+styles: typeof unboundStyles,\n};\n@@ -62,10 +67,19 @@ const unboundStyles = {\nconst ConnectedThreadListThread: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedThreadListThread(props: BaseProps) {\n+ const { threadInfo, ...rest } = props;\nconst styles = useStyles(unboundStyles);\nconst colors = useColors();\n+ const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);\n- return <ThreadListThread {...props} styles={styles} colors={colors} />;\n+ return (\n+ <ThreadListThread\n+ {...rest}\n+ threadInfo={resolvedThreadInfo}\n+ styles={styles}\n+ colors={colors}\n+ />\n+ );\n},\n);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in ThreadListThread
Summary: Depends on D6600
Test Plan: | {F363571} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6601 |
129,187 | 04.02.2023 20:30:45 | 18,000 | ab7ddcd6ddff53c80cee70aad3c2090c5c3d2477 | [native] Fetch ENS names in ThreadPill
Summary: Depends on D6601
Test Plan: | {F363574} | {F363575} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/components/thread-pill.react.js",
"new_path": "native/components/thread-pill.react.js",
"diff": "import * as React from 'react';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Pill from './pill.react';\n@@ -13,10 +14,11 @@ type Props = {\n};\nfunction ThreadPill(props: Props): React.Node {\nconst { threadInfo, roundCorners, fontSize } = props;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<Pill\nbackgroundColor={`#${threadInfo.color}`}\n- label={threadInfo.uiName}\n+ label={uiName}\nroundCorners={roundCorners}\nfontSize={fontSize}\n/>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in ThreadPill
Summary: Depends on D6601
Test Plan: | {F363574} | {F363575} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6602 |
129,187 | 04.02.2023 20:30:58 | 18,000 | cf705aae83dca2ff47eb2343749cd6b4f09e099a | [native] Fetch ENS names in CommunityDrawer
Summary: Depends on D6602
Test Plan: | {F363578} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "native/navigation/community-drawer-content.react.js",
"new_path": "native/navigation/community-drawer-content.react.js",
"diff": "@@ -10,7 +10,12 @@ import {\ncommunityThreadSelector,\n} from 'lib/selectors/thread-selectors';\nimport { threadIsChannel } from 'lib/shared/thread-utils';\n-import { type ThreadInfo, communitySubthreads } from 'lib/types/thread-types';\n+import {\n+ type ThreadInfo,\n+ type ResolvedThreadInfo,\n+ communitySubthreads,\n+} from 'lib/types/thread-types';\n+import { useResolvedThreadInfos } from 'lib/utils/entity-helpers';\nimport { useNavigateToThread } from '../chat/message-list-types';\nimport { useStyles } from '../themes/colors';\n@@ -25,9 +30,11 @@ const safeAreaEdges = Platform.select({\nfunction CommunityDrawerContent(): React.Node {\nconst communities = useSelector(communityThreadSelector);\n- const communitiesSuffixed = React.useMemo(() => appendSuffix(communities), [\n- communities,\n- ]);\n+ const resolvedCommunities = useResolvedThreadInfos(communities);\n+ const communitiesSuffixed = React.useMemo(\n+ () => appendSuffix(resolvedCommunities),\n+ [resolvedCommunities],\n+ );\nconst styles = useStyles(unboundStyles);\nconst [openCommunity, setOpenCommunity] = React.useState(\n@@ -91,7 +98,7 @@ function CommunityDrawerContent(): React.Node {\nfunction createRecursiveDrawerItemsData(\nchildThreadInfosMap: { +[id: string]: $ReadOnlyArray<ThreadInfo> },\n- communities: $ReadOnlyArray<ThreadInfo>,\n+ communities: $ReadOnlyArray<ResolvedThreadInfo>,\nlabelStyles: $ReadOnlyArray<TextStyle>,\n) {\nconst result = communities.map(community => ({\n@@ -138,7 +145,9 @@ function threadHasSubchannels(\n);\n}\n-function appendSuffix(chats: $ReadOnlyArray<ThreadInfo>): ThreadInfo[] {\n+function appendSuffix(\n+ chats: $ReadOnlyArray<ResolvedThreadInfo>,\n+): ResolvedThreadInfo[] {\nconst result = [];\nconst names = new Map<string, number>();\n"
},
{
"change_type": "MODIFY",
"old_path": "native/navigation/community-drawer-item.react.js",
"new_path": "native/navigation/community-drawer-item.react.js",
"diff": "@@ -4,6 +4,7 @@ import * as React from 'react';\nimport { View, FlatList, TouchableOpacity } from 'react-native';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport type { MessageListParams } from '../chat/message-list-types';\nimport { SingleLine } from '../components/single-line.react';\n@@ -83,6 +84,7 @@ function CommunityDrawerItem(props: DrawerItemProps): React.Node {\nnavigateToThread({ threadInfo });\n}, [navigateToThread, threadInfo]);\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<View>\n<View style={styles.threadEntry}>\n@@ -92,7 +94,7 @@ function CommunityDrawerItem(props: DrawerItemProps): React.Node {\nstyle={styles.textTouchableWrapper}\nonLongPress={onExpandToggled}\n>\n- <SingleLine style={labelStyle}>{threadInfo.uiName}</SingleLine>\n+ <SingleLine style={labelStyle}>{uiName}</SingleLine>\n</TouchableOpacity>\n</View>\n{children}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fetch ENS names in CommunityDrawer
Summary: Depends on D6602
Test Plan: | {F363578} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6603 |
129,187 | 04.02.2023 21:12:33 | 18,000 | 3258e1885963eeaf238d5d8e477f2d3b43edfbbb | [web] Fetch ENS names in Entry
Summary: Depends on D6603
Test Plan: | {F363581} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/calendar/entry.react.js",
"new_path": "web/calendar/entry.react.js",
"diff": "@@ -36,13 +36,14 @@ import {\nimport type { LoadingStatus } from 'lib/types/loading-types';\nimport type { Dispatch } from 'lib/types/redux-types';\nimport { threadPermissions } from 'lib/types/thread-types';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n+import type { ResolvedThreadInfo } from 'lib/types/thread-types';\nimport {\ntype DispatchActionPromise,\nuseServerCall,\nuseDispatchActionPromise,\n} from 'lib/utils/action-utils';\nimport { dateString } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { ServerError } from 'lib/utils/errors';\nimport LoadingIndicator from '../loading-indicator.react';\n@@ -62,7 +63,7 @@ type BaseProps = {\n};\ntype Props = {\n...BaseProps,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+loggedIn: boolean,\n+calendarQuery: () => CalendarQuery,\n+online: boolean,\n@@ -462,9 +463,10 @@ export type InnerEntry = Entry;\nconst ConnectedEntry: React.ComponentType<BaseProps> = React.memo<BaseProps>(\nfunction ConnectedEntry(props) {\nconst { threadID } = props.entryInfo;\n- const threadInfo = useSelector(\n+ const unresolvedThreadInfo = useSelector(\nstate => threadInfoSelector(state)[threadID],\n);\n+ const threadInfo = useResolvedThreadInfo(unresolvedThreadInfo);\nconst loggedIn = useSelector(\nstate =>\n!!(state.currentUserInfo && !state.currentUserInfo.anonymous && true),\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in Entry
Summary: Depends on D6603
Test Plan: | {F363581} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6604 |
129,187 | 04.02.2023 21:12:47 | 18,000 | 5c94cad2e2981fc2059f7d9e1aa7b1a68b95963f | [web] Fetch ENS names in ChatThreadAncestors
Summary: Depends on D6604
Test Plan: | {F363583} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/chat/chat-thread-ancestors.react.js",
"new_path": "web/chat/chat-thread-ancestors.react.js",
"diff": "@@ -7,6 +7,7 @@ import { useAncestorThreads } from 'lib/shared/ancestor-threads';\nimport { colorIsDark } from 'lib/shared/thread-utils';\nimport { useKeyserverAdmin } from 'lib/shared/user-utils';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport CommIcon from '../CommIcon.react';\nimport SWMansionIcon from '../SWMansionIcon.react';\n@@ -41,6 +42,8 @@ function ThreadAncestors(props: ThreadAncestorsProps): React.Node {\nconst keyserverAdmin = useKeyserverAdmin(community);\nconst keyserverOwnerUsername = keyserverAdmin?.username;\n+ const resolvedCommunity = useResolvedThreadInfo(community);\n+\nconst keyserverInfo = React.useMemo(\n() => (\n<div className={css.ancestorKeyserver}>\n@@ -52,11 +55,11 @@ function ThreadAncestors(props: ThreadAncestorsProps): React.Node {\nstyle={threadColorStyle}\nclassName={classNames(css.ancestorName, css.ancestorKeyserverName)}\n>\n- {community.uiName}\n+ {resolvedCommunity.uiName}\n</div>\n</div>\n),\n- [community.uiName, keyserverOwnerUsername, threadColorStyle],\n+ [resolvedCommunity.uiName, keyserverOwnerUsername, threadColorStyle],\n);\nconst middlePath = React.useMemo(() => {\n@@ -79,6 +82,7 @@ function ThreadAncestors(props: ThreadAncestorsProps): React.Node {\nconst threadHasNoAncestors = community === threadInfo;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nconst currentThread = React.useMemo(() => {\nif (threadHasNoAncestors) {\nreturn null;\n@@ -91,11 +95,11 @@ function ThreadAncestors(props: ThreadAncestorsProps): React.Node {\nsize={12}\n/>\n<div style={threadColorStyle} className={css.ancestorName}>\n- {threadInfo.uiName}\n+ {uiName}\n</div>\n</>\n);\n- }, [threadHasNoAncestors, threadColorStyle, threadInfo.uiName]);\n+ }, [threadHasNoAncestors, threadColorStyle, uiName]);\nlet seeFullStructure = null;\nif (SHOW_SEE_FULL_STRUCTURE) {\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ChatThreadAncestors
Summary: Depends on D6604
Test Plan: | {F363583} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6605 |
129,187 | 04.02.2023 21:13:03 | 18,000 | f90d790201189acdddad79b0ccf286846b82b87e | [web] Fetch ENS names in ChatThreadListItem
Summary: Depends on D6605
Test Plan: | {F363586} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/chat/chat-thread-list-item.react.js",
"new_path": "web/chat/chat-thread-list-item.react.js",
"diff": "@@ -6,6 +6,10 @@ import * as React from 'react';\nimport type { ChatThreadItem } from 'lib/selectors/chat-selectors';\nimport { useAncestorThreads } from 'lib/shared/ancestor-threads';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import {\n+ useResolvedThreadInfo,\n+ useResolvedThreadInfos,\n+} from 'lib/utils/entity-helpers';\nimport { useSelector } from '../redux/redux-utils';\nimport {\n@@ -32,7 +36,8 @@ function ChatThreadListItem(props: Props): React.Node {\n} = item;\nconst { id: threadID, currentUser } = threadInfo;\n- const ancestorThreads = useAncestorThreads(threadInfo);\n+ const unresolvedAncestorThreads = useAncestorThreads(threadInfo);\n+ const ancestorThreads = useResolvedThreadInfos(unresolvedAncestorThreads);\nconst lastActivity = shortAbsoluteDate(lastUpdatedTimeIncludingSidebars);\n@@ -122,6 +127,7 @@ function ChatThreadListItem(props: Props): React.Node {\n);\n});\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<>\n<a className={containerClassName} onClick={selectItemIfNotActiveCreation}>\n@@ -134,7 +140,7 @@ function ChatThreadListItem(props: Props): React.Node {\n<div className={css.threadButton}>\n<p className={breadCrumbsClassName}>{ancestorPath}</p>\n<div className={css.threadRow}>\n- <div className={titleClassName}>{threadInfo.uiName}</div>\n+ <div className={titleClassName}>{uiName}</div>\n</div>\n<div className={css.threadRow}>\n<MessagePreview\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ChatThreadListItem
Summary: Depends on D6605
Test Plan: | {F363586} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6606 |
129,187 | 04.02.2023 21:13:18 | 18,000 | 77514b3d45786e16cde661bcc011f4cc7dea992a | [web] Fetch ENS names in SidebarItem
Summary: Depends on D6606
Test Plan: | {F363588} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/chat/sidebar-item.react.js",
"new_path": "web/chat/sidebar-item.react.js",
"diff": "@@ -4,6 +4,7 @@ import classNames from 'classnames';\nimport * as React from 'react';\nimport type { SidebarInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { useOnClickThread } from '../selectors/thread-selectors';\nimport css from './chat-thread-list.css';\n@@ -38,14 +39,14 @@ function SidebarItem(props: Props): React.Node {\n<img src=\"images/arrow.svg\" className={css.arrow} alt=\"thread arrow\" />\n);\n}\n-\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<>\n{arrow}\n<div className={css.spacer} />\n<a className={css.threadButtonSidebar} onClick={onClick}>\n<div className={css.threadRow}>\n- <div className={unreadCls}>{threadInfo.uiName}</div>\n+ <div className={unreadCls}>{uiName}</div>\n</div>\n</a>\n</>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in SidebarItem
Summary: Depends on D6606
Test Plan: | {F363588} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6607 |
129,187 | 04.02.2023 21:13:31 | 18,000 | 27e1025ac0c25009d5feccdec58fc7ca01e1b054 | [web] Fetch ENS names in ThreadTopBar
Summary: Depends on D6607
Test Plan: | {F363583} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/chat/thread-top-bar.react.js",
"new_path": "web/chat/thread-top-bar.react.js",
"diff": "@@ -4,6 +4,7 @@ import * as React from 'react';\nimport { threadIsPending } from 'lib/shared/thread-utils';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport ThreadAncestors from './chat-thread-ancestors.react';\nimport ThreadMenu from './thread-menu.react';\n@@ -26,6 +27,7 @@ function ThreadTopBar(props: threadTopBarProps): React.Node {\nthreadMenu = <ThreadMenu threadInfo={threadInfo} />;\n}\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<div className={css.topBarContainer}>\n<div className={css.topBarThreadInfo}>\n@@ -33,7 +35,7 @@ function ThreadTopBar(props: threadTopBarProps): React.Node {\nclassName={css.threadColorSquare}\nstyle={threadBackgroundColorStyle}\n/>\n- <p className={css.threadTitle}>{threadInfo.uiName}</p>\n+ <p className={css.threadTitle}>{uiName}</p>\n<ThreadAncestors threadInfo={threadInfo} />\n</div>\n{threadMenu}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ThreadTopBar
Summary: Depends on D6607
Test Plan: | {F363583} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6608 |
129,187 | 04.02.2023 21:13:45 | 18,000 | cca11523db87f9d173eca8dd6e015b89c608e36c | [web] Fetch ENS names in SidebarPromoteModal
Summary: Depends on D6608
Test Plan: | {F363590} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/chat/sidebar-promote-modal.react.js",
"new_path": "web/modals/chat/sidebar-promote-modal.react.js",
"diff": "import * as React from 'react';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../../components/button.react';\nimport Modal from '../modal.react';\n@@ -16,7 +17,7 @@ type Props = {\nfunction SidebarPromoteModal(props: Props): React.Node {\nconst { threadInfo, onClose, onConfirm } = props;\n- const { uiName } = threadInfo;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nconst handleConfirm = React.useCallback(() => {\nonConfirm();\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in SidebarPromoteModal
Summary: Depends on D6608
Test Plan: | {F363590} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6609 |
129,187 | 04.02.2023 21:14:00 | 18,000 | ece6ba25398d27d2ea934716597bcf62105973a6 | [web] Fetch ENS names in HistoryEntry
Summary: Depends on D6609
Test Plan: | {F363597} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/history/history-entry.react.js",
"new_path": "web/modals/history/history-entry.react.js",
"diff": "@@ -19,13 +19,14 @@ import {\ntype CalendarQuery,\n} from 'lib/types/entry-types';\nimport type { LoadingStatus } from 'lib/types/loading-types';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n+import type { ResolvedThreadInfo } from 'lib/types/thread-types';\nimport type { UserInfo } from 'lib/types/user-types';\nimport {\ntype DispatchActionPromise,\nuseDispatchActionPromise,\nuseServerCall,\n} from 'lib/utils/action-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport LoadingIndicator from '../../loading-indicator.react';\nimport { useSelector } from '../../redux/redux-utils';\n@@ -39,7 +40,7 @@ type BaseProps = {\n};\ntype Props = {\n...BaseProps,\n- +threadInfo: ThreadInfo,\n+ +threadInfo: ResolvedThreadInfo,\n+loggedIn: boolean,\n+restoreLoadingStatus: LoadingStatus,\n+calendarQuery: () => CalendarQuery,\n@@ -149,9 +150,10 @@ const ConnectedHistoryEntry: React.ComponentType<BaseProps> = React.memo<BasePro\nfunction ConnectedHistoryEntry(props) {\nconst entryID = props.entryInfo.id;\ninvariant(entryID, 'entryInfo.id (serverID) should be set');\n- const threadInfo = useSelector(\n+ const unresolvedThreadInfo = useSelector(\nstate => threadInfoSelector(state)[props.entryInfo.threadID],\n);\n+ const threadInfo = useResolvedThreadInfo(unresolvedThreadInfo);\nconst loggedIn = useSelector(\nstate =>\n!!(state.currentUserInfo && !state.currentUserInfo.anonymous && true),\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in HistoryEntry
Summary: Depends on D6609
Test Plan: | {F363597} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6610 |
129,187 | 04.02.2023 21:14:15 | 18,000 | 01620f476f963e3221c5f98fb67d8cd7610f5bdf | [web] Fetch ENS names in ConfirmLeaveThreadModal
Summary: Depends on D6610
Test Plan: | {F363600} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/threads/confirm-leave-thread-modal.react.js",
"new_path": "web/modals/threads/confirm-leave-thread-modal.react.js",
"diff": "import * as React from 'react';\nimport { type ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button, { buttonThemes } from '../../components/button.react';\nimport Modal from '../modal.react';\n@@ -15,7 +16,7 @@ type Props = {\n};\nfunction ConfirmLeaveThreadModal(props: Props): React.Node {\nconst { threadInfo, onClose, onConfirm } = props;\n- const { uiName } = threadInfo;\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<Modal\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ConfirmLeaveThreadModal
Summary: Depends on D6610
Test Plan: | {F363600} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6611 |
129,187 | 04.02.2023 21:14:29 | 18,000 | f1a548cf27f227c2e0d34c4257e4acbb15f0fb3e | [web] Fetch ENS names in ComposeSubchannelModal
Summary: Depends on D6611
Test Plan: | {F363604} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/threads/create/compose-subchannel-modal.react.js",
"new_path": "web/modals/threads/create/compose-subchannel-modal.react.js",
"diff": "@@ -10,6 +10,7 @@ import {\nuseDispatchActionPromise,\nuseServerCall,\n} from 'lib/utils/action-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport { trimText } from 'lib/utils/text-utils';\nimport Stepper from '../../../components/stepper.react';\n@@ -62,7 +63,7 @@ const createSubchannelLoadingStatusSelector = createLoadingStatusSelector(\nfunction ComposeSubchannelModal(props: Props): React.Node {\nconst { parentThreadInfo, onClose } = props;\n- const { uiName: parentThreadName } = parentThreadInfo;\n+ const { uiName: parentThreadName } = useResolvedThreadInfo(parentThreadInfo);\nconst [activeStep, setActiveStep] = React.useState<Steps>('settings');\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ComposeSubchannelModal
Summary: Depends on D6611
Test Plan: | {F363604} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6612 |
129,187 | 04.02.2023 21:14:45 | 18,000 | cb46d688b27088a09f25d7f65790a378af7b0cf7 | [web] Fetch ENS names in thread modals
Summary: Depends on D6612
Test Plan: | {F363606} | {F363607} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/threads/sidebars/sidebar.react.js",
"new_path": "web/modals/threads/sidebars/sidebar.react.js",
"diff": "// @flow\n+\nimport classNames from 'classnames';\nimport * as React from 'react';\n@@ -6,6 +7,7 @@ import { useModalContext } from 'lib/components/modal-provider.react';\nimport type { ChatThreadItem } from 'lib/selectors/chat-selectors';\nimport { useMessagePreview } from 'lib/shared/message-utils';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../../../components/button.react';\nimport { getDefaultTextMessageRules } from '../../../markdown/rules.react';\n@@ -65,6 +67,7 @@ function Sidebar(props: Props): React.Node {\n);\n}, [lastActivity, messagePreviewResult]);\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<Button className={css.sidebarContainer} onClick={onClickThread}>\n<img\n@@ -77,7 +80,7 @@ function Sidebar(props: Props): React.Node {\nalt=\"sidebar arrow\"\n/>\n<div className={sidebarInfoClassName}>\n- <div className={css.longTextEllipsis}>{threadInfo.uiName}</div>\n+ <div className={css.longTextEllipsis}>{uiName}</div>\n<div className={css.lastMessage}>{lastMessage}</div>\n</div>\n</Button>\n"
},
{
"change_type": "MODIFY",
"old_path": "web/modals/threads/subchannels/subchannel.react.js",
"new_path": "web/modals/threads/subchannels/subchannel.react.js",
"diff": "@@ -7,6 +7,7 @@ import { useModalContext } from 'lib/components/modal-provider.react';\nimport { type ChatThreadItem } from 'lib/selectors/chat-selectors';\nimport { useMessagePreview } from 'lib/shared/message-utils';\nimport { shortAbsoluteDate } from 'lib/utils/date-utils';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../../../components/button.react';\nimport { getDefaultTextMessageRules } from '../../../markdown/rules.react';\n@@ -72,11 +73,12 @@ function Subchannel(props: Props): React.Node {\n);\n}, [lastActivity, messagePreviewResult]);\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<Button className={css.subchannelContainer} onClick={onClickThread}>\n<SWMansionIcon icon=\"message-square\" size={22} />\n<div className={subchannelTitleClassName}>\n- <div className={css.longTextEllipsis}>{threadInfo.uiName}</div>\n+ <div className={css.longTextEllipsis}>{uiName}</div>\n<div className={css.lastMessage}>{lastMessage}</div>\n</div>\n</Button>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in thread modals
Summary: Depends on D6612
Test Plan: | {F363606} | {F363607} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6613 |
129,187 | 04.02.2023 21:15:03 | 18,000 | 4031d3ba1f8f8e7a70baf4e7e3f7eba5293b215d | [web] Fetch ENS names in ThreadPickerModal
Summary: Depends on D6613
Test Plan: | {F363610} |
Reviewers: atul
Subscribers: tomek | [
{
"change_type": "MODIFY",
"old_path": "web/modals/threads/thread-picker-modal.react.js",
"new_path": "web/modals/threads/thread-picker-modal.react.js",
"diff": "@@ -7,6 +7,7 @@ import { createSelector } from 'reselect';\nimport { useGlobalThreadSearchIndex } from 'lib/selectors/nav-selectors';\nimport { onScreenEntryEditableThreadInfos } from 'lib/selectors/thread-selectors';\nimport type { ThreadInfo } from 'lib/types/thread-types';\n+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';\nimport Button from '../../components/button.react';\nimport Search from '../../components/search.react';\n@@ -35,6 +36,7 @@ function ThreadPickerOption(props: OptionProps) {\n[threadInfo.color],\n);\n+ const { uiName } = useResolvedThreadInfo(threadInfo);\nreturn (\n<div key={threadInfo.id} className={css.threadPickerOptionContainer}>\n<Button\n@@ -42,7 +44,7 @@ function ThreadPickerOption(props: OptionProps) {\nonClick={onClickThreadOption}\n>\n<div style={splotchColorStyle} className={css.threadSplotch} />\n- <div className={css.threadNameText}>{threadInfo.uiName}</div>\n+ <div className={css.threadNameText}>{uiName}</div>\n</Button>\n</div>\n);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Fetch ENS names in ThreadPickerModal
Summary: Depends on D6613
Test Plan: | {F363610} |
Reviewers: atul
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D6614 |
129,187 | 05.02.2023 15:40:04 | 18,000 | 43d39ba2bd353081baf99eb10399ef51ab533060 | [native] Cleanup of sidebar animation code
Summary: Noticed some quick cleanup that could be done here.
Test Plan: Testing sidebar animations manually, Flow
Reviewers: tomek
Subscribers: atul | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-context-provider.react.js",
"new_path": "native/chat/chat-context-provider.react.js",
"diff": "@@ -126,11 +126,6 @@ function ChatContextProvider(props: Props): React.Node {\nsidebarAnimationType,\nsetSidebarAnimationType,\n] = React.useState<SidebarAnimationType>('move_source_message');\n- const setSidebarAnimationTypeCallback = React.useCallback(\n- (animationType: SidebarAnimationType) =>\n- setSidebarAnimationType(animationType),\n- [],\n- );\nconst contextValue = React.useMemo(\n() => ({\n@@ -141,14 +136,13 @@ function ChatContextProvider(props: Props): React.Node {\ndeleteChatInputBarHeight,\nchatInputBarHeights: chatInputBarHeights.current,\nsidebarAnimationType,\n- setSidebarAnimationType: setSidebarAnimationTypeCallback,\n+ setSidebarAnimationType,\n}),\n[\ncurrentTransitionSidebarSourceID,\ndeleteChatInputBarHeight,\nregisterMeasurer,\nsetChatInputBarHeight,\n- setSidebarAnimationTypeCallback,\nsidebarAnimationType,\n],\n);\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/utils.js",
"new_path": "native/chat/utils.js",
"diff": "@@ -227,24 +227,17 @@ function useAnimatedMessageTooltipButton({\nconst currentInputBarHeight =\nchatInputBarHeights.get(sourceMessage.threadInfo.id) ?? 0;\nconst keyboardState = React.useContext(KeyboardContext);\n- const viewerIsSidebarMember = viewerIsMember(sidebarThreadInfo);\n- React.useEffect(() => {\n+\nconst newSidebarAnimationType =\n!currentInputBarHeight ||\n!targetInputBarHeight ||\nkeyboardState?.keyboardShowing ||\n- !viewerIsSidebarMember\n+ !viewerIsMember(sidebarThreadInfo)\n? 'fade_source_message'\n: 'move_source_message';\n+ React.useEffect(() => {\nsetSidebarAnimationType(newSidebarAnimationType);\n- }, [\n- currentInputBarHeight,\n- keyboardState?.keyboardShowing,\n- setSidebarAnimationType,\n- sidebarThreadInfo,\n- targetInputBarHeight,\n- viewerIsSidebarMember,\n- ]);\n+ }, [setSidebarAnimationType, newSidebarAnimationType]);\nconst {\nposition: targetPosition,\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Cleanup of sidebar animation code
Summary: Noticed some quick cleanup that could be done here.
Test Plan: Testing sidebar animations manually, Flow
Reviewers: tomek
Reviewed By: tomek
Subscribers: atul
Differential Revision: https://phab.comm.dev/D6553 |
129,184 | 06.02.2023 12:50:59 | 18,000 | 1df81b89dc6b43f144803abbc36657e68a88acd3 | [native] Flip the switch to enable `SIWE` on `native`
Summary: Basically don't gate "Sign in with Ethereum" button on `__DEV__` check.
Test Plan:
SIWE button appears on prod build as expected. I'm able to log in via Ethereum wallet on prod.
{F365356}
Reviewers: ashoat, tomek | [
{
"change_type": "MODIFY",
"old_path": "native/account/logged-out-modal.react.js",
"new_path": "native/account/logged-out-modal.react.js",
"diff": "@@ -463,11 +463,7 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\nrender() {\nconst { styles } = this.props;\n- let panel = null;\n- let buttons = null;\n- let siweButton = null;\n- if (__DEV__) {\n- siweButton = (\n+ const siweButton = (\n<>\n<TouchableOpacity\nonPress={this.onPressSIWE}\n@@ -488,8 +484,9 @@ class LoggedOutModal extends React.PureComponent<Props, State> {\n</View>\n</>\n);\n- }\n+ let panel = null;\n+ let buttons = null;\nif (this.state.mode === 'log-in') {\npanel = (\n<LogInPanel\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Flip the switch to enable `SIWE` on `native`
Summary: Basically don't gate "Sign in with Ethereum" button on `__DEV__` check.
Test Plan:
SIWE button appears on prod build as expected. I'm able to log in via Ethereum wallet on prod.
{F365356}
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6619 |
129,184 | 06.02.2023 14:06:04 | 18,000 | 87aa6083d6f45d5abadc27afd59b4d8293a8c06d | [native] `codeVersion` -> 185 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -471,8 +471,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 184\n- versionName '1.0.184'\n+ versionCode 185\n+ versionName '1.0.185'\nbuildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\nif (isNewArchitectureEnabled()) {\n// We configure the CMake build only if you decide to opt-in for the New Architecture.\n"
},
{
"change_type": "MODIFY",
"old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{184};\n+ const int codeVersion{185};\nstd::unique_ptr<WorkerThread> cryptoThread;\nCommSecureStore secureStore;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"new_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"diff": "CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\n- CURRENT_PROJECT_VERSION = 184;\n+ CURRENT_PROJECT_VERSION = 185;\nDEBUG_INFORMATION_FORMAT = dwarf;\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.184;\n+ MARKETING_VERSION = 1.0.185;\nMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\nMTL_FAST_MATH = YES;\nOTHER_CFLAGS = (\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\nCOPY_PHASE_STRIP = NO;\n- CURRENT_PROJECT_VERSION = 184;\n+ CURRENT_PROJECT_VERSION = 185;\nDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.184;\n+ MARKETING_VERSION = 1.0.185;\nMTL_FAST_MATH = YES;\nONLY_ACTIVE_ARCH = YES;\nOTHER_CFLAGS = (\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.debug.plist",
"new_path": "native/ios/Comm/Info.debug.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.184</string>\n+ <string>1.0.185</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>184</string>\n+ <string>185</string>\n<key>CFBundleURLTypes</key>\n<array>\n<dict>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.release.plist",
"new_path": "native/ios/Comm/Info.release.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.184</string>\n+ <string>1.0.185</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>184</string>\n+ <string>185</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>rainbow</string>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] `codeVersion` -> 185 |
129,184 | 06.02.2023 14:08:29 | 18,000 | 914725eba34a3d8a62c863880a0c7fe9d029aadd | [native] `codeVersion` -> 186 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -471,8 +471,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 185\n- versionName '1.0.185'\n+ versionCode 186\n+ versionName '1.0.186'\nbuildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\nif (isNewArchitectureEnabled()) {\n// We configure the CMake build only if you decide to opt-in for the New Architecture.\n"
},
{
"change_type": "MODIFY",
"old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{185};\n+ const int codeVersion{186};\nstd::unique_ptr<WorkerThread> cryptoThread;\nCommSecureStore secureStore;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"new_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"diff": "CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\n- CURRENT_PROJECT_VERSION = 185;\n+ CURRENT_PROJECT_VERSION = 186;\nDEBUG_INFORMATION_FORMAT = dwarf;\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.185;\n+ MARKETING_VERSION = 1.0.186;\nMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\nMTL_FAST_MATH = YES;\nOTHER_CFLAGS = (\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\nCOPY_PHASE_STRIP = NO;\n- CURRENT_PROJECT_VERSION = 185;\n+ CURRENT_PROJECT_VERSION = 186;\nDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.185;\n+ MARKETING_VERSION = 1.0.186;\nMTL_FAST_MATH = YES;\nONLY_ACTIVE_ARCH = YES;\nOTHER_CFLAGS = (\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.debug.plist",
"new_path": "native/ios/Comm/Info.debug.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.185</string>\n+ <string>1.0.186</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>185</string>\n+ <string>186</string>\n<key>CFBundleURLTypes</key>\n<array>\n<dict>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.release.plist",
"new_path": "native/ios/Comm/Info.release.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.185</string>\n+ <string>1.0.186</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>185</string>\n+ <string>186</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>rainbow</string>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] `codeVersion` -> 186 |
129,184 | 06.02.2023 14:14:50 | 18,000 | 40d681947cd29b125ce6739ec8130efafa413aa7 | [web] Add `groupName` to `connectorsForWallets(...)`
Summary: Without specifying `groupName`, the wallets don't show up at all on `web` in the `ConnectModal`. They, however, still show up on `landing` in the "bottomsheet" view:
Test Plan: Wallets appear correctly on both `web` and `landing`.
Reviewers: ashoat, tomek | [
{
"change_type": "MODIFY",
"old_path": "web/utils/wagmi-utils.js",
"new_path": "web/utils/wagmi-utils.js",
"diff": "@@ -10,6 +10,7 @@ import { configureWagmiChains, createWagmiClient } from 'lib/utils/wagmi-utils';\nconst { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);\nconst connectors = connectorsForWallets([\n{\n+ groupName: 'Recommended',\nwallets: [\nwallet.injected({ chains }),\nwallet.rainbow({ chains }),\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Add `groupName` to `connectorsForWallets(...)`
Summary: Without specifying `groupName`, the wallets don't show up at all on `web` in the `ConnectModal`. They, however, still show up on `landing` in the "bottomsheet" view: https://blob.sh/fb6314.png
Test Plan: Wallets appear correctly on both `web` and `landing`.
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6630 |
129,184 | 06.02.2023 14:39:33 | 18,000 | 63785b238c43dc74c60d86fc1201f4adf4e7e3b1 | [native] Add `copy-filled` icon to `CommIcons.ttf`
Summary: Context:
Test Plan:
Looks as expected:
{F367136}
Reviewers: tomek, ginsu, rohan, varun | [
{
"change_type": "MODIFY",
"old_path": "lib/shared/comm-icon-config.json",
"new_path": "lib/shared/comm-icon-config.json",
"diff": "{\n\"icon\": {\n\"paths\": [\n- \"M579.231 341.333h-362.019c-57.125 0-103.434 46.309-103.434 103.434v362.019c0 57.128 46.309 103.435 103.434 103.435h362.019c57.128 0 103.435-46.308 103.435-103.435v-362.019c0-57.125-46.308-103.434-103.435-103.434z\",\n- \"M444.768 113.778h362.019c57.128 0 103.435 46.309 103.435 103.434v362.019c0 57.128-46.308 103.435-103.435 103.435h-10.342v-341.333c0-57.125-56.65-113.778-113.778-113.778h-341.333v-10.344c0-57.125 46.309-103.434 103.434-103.434z\",\n- \"M227.556 341.333h341.333c62.838 0 113.778 50.94 113.778 113.778v341.333c0 62.838-50.94 113.778-113.778 113.778h-341.333c-62.838 0-113.778-50.94-113.778-113.778v-341.333c0-62.838 50.94-113.778 113.778-113.778z\",\n- \"M455.111 113.778c-62.838 0-113.778 50.94-113.778 113.778h227.556c125.673 0 227.556 101.88 227.556 227.556v227.556c62.839 0 113.778-50.938 113.778-113.778v-341.333c0-62.838-50.938-113.778-113.778-113.778h-341.333z\"\n+ \"M501.333 384c64.802 0 117.333 52.531 117.333 117.333v298.667l-0.214 7.148c-3.694 61.474-54.717 110.186-117.119 110.186l-305.814-0.214c-61.473-3.694-110.186-54.717-110.186-117.119v-298.667c0-64.802 52.532-117.333 117.333-117.333h298.667z\",\n+ \"M800 85.333c64.802 0 117.333 52.531 117.333 117.333v298.028c0 0.426-0.006 0.852-0.019 1.278l-0.195 6.509c-3.694 61.474-54.717 110.186-117.119 110.186h-53.333c-23.564 0-42.667-19.103-42.667-42.667v-160c0-62.402-48.712-113.425-110.186-117.119l-6.509-0.195c-0.426-0.013-0.852-0.019-1.278-0.019h-159.361c-23.564 0-42.667-19.103-42.667-42.667v-53.333c0-64.802 52.532-117.333 117.333-117.333h298.667z\"\n],\n- \"attrs\": [],\n+ \"attrs\": [{}, {}],\n\"isMulticolor\": false,\n\"isMulticolor2\": false,\n\"colorPermutations\": {},\n\"tags\": [\"copy-filled\"],\n\"grid\": 0\n},\n- \"attrs\": [],\n+ \"attrs\": [{}, {}],\n\"properties\": {\n\"order\": 376,\n\"id\": 6,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/fonts/CommIcons.ttf",
"new_path": "native/fonts/CommIcons.ttf",
"diff": "Binary files a/native/fonts/CommIcons.ttf and b/native/fonts/CommIcons.ttf differ\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Add `copy-filled` icon to `CommIcons.ttf`
Summary: Context: https://linear.app/comm/issue/ENG-2579/add-copy-filled-icon-to-native-icons-font
Test Plan:
Looks as expected:
{F367136}
Reviewers: tomek, ginsu, rohan, varun
Reviewed By: ginsu
Differential Revision: https://phab.comm.dev/D6631 |
129,184 | 07.02.2023 12:03:30 | 18,000 | 587103fd89d20d3011cbac55f31df2c65d69f5ad | [lib] Move `ConnectedWalletInfo` from `web` -> `lib`
Summary:
So it can be used across `web` and `landing` (for native SIWE).
Depends on D6638
Test Plan:
Things continue to look as expected:
{F367497}
Reviewers: ashoat, tomek | [
{
"change_type": "RENAME",
"old_path": "web/account/connected-wallet-info.css",
"new_path": "lib/components/connected-wallet-info.css",
"diff": ""
},
{
"change_type": "RENAME",
"old_path": "web/account/connected-wallet-info.react.js",
"new_path": "lib/components/connected-wallet-info.react.js",
"diff": "@@ -4,10 +4,9 @@ import { emojiAvatarForAddress, useAccountModal } from '@rainbow-me/rainbowkit';\nimport * as React from 'react';\nimport { useAccount, useEnsAvatar } from 'wagmi';\n-import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';\n-import { useENSName } from 'lib/hooks/ens-cache.js';\n-\n+import { useENSName } from '../hooks/ens-cache.js';\nimport css from './connected-wallet-info.css';\n+import SWMansionIcon from './SWMansionIcon.react.js';\nfunction shortenAddressToFitWidth(address: string): string {\nif (address.length < 22) {\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/package.json",
"new_path": "lib/package.json",
"diff": "\"react-refresh\": \"^0.14.0\"\n},\n\"dependencies\": {\n+ \"@rainbow-me/rainbowkit\": \"^0.5.0\",\n\"dateformat\": \"^3.0.3\",\n\"emoji-regex\": \"^10.2.1\",\n\"eth-ens-namehash\": \"^2.0.8\",\n"
},
{
"change_type": "MODIFY",
"old_path": "web/account/siwe-login-form.react.js",
"new_path": "web/account/siwe-login-form.react.js",
"diff": "@@ -14,6 +14,7 @@ import {\nsiweAuth,\nsiweAuthActionTypes,\n} from 'lib/actions/siwe-actions';\n+import ConnectedWalletInfo from 'lib/components/connected-wallet-info.react.js';\nimport SWMansionIcon from 'lib/components/SWMansionIcon.react.js';\nimport { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\nimport type { LogInStartingPayload } from 'lib/types/account-types.js';\n@@ -33,7 +34,6 @@ import LoadingIndicator from '../loading-indicator.react';\nimport { setPrimaryIdentityPublicKey } from '../redux/primary-identity-public-key-reducer';\nimport { useSelector } from '../redux/redux-utils';\nimport { webLogInExtraInfoSelector } from '../selectors/account-selectors.js';\n-import ConnectedWalletInfo from './connected-wallet-info.react.js';\nimport HeaderSeparator from './header-separator.react.js';\nimport css from './siwe.css';\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [lib] Move `ConnectedWalletInfo` from `web` -> `lib`
Summary:
So it can be used across `web` and `landing` (for native SIWE).
---
Depends on D6638
Test Plan:
Things continue to look as expected:
{F367497}
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6639 |
129,184 | 06.02.2023 20:38:39 | 18,000 | b3b0853cb8e2a7e821fbb88e5394e6a46c56005b | [web] Flip the switch to enable SIWE on `web`
Summary:
Remove the `isDev` checks from `LoginForm` component and display either
A. `TraditionalLoginForm` and `SIWEButton` or
B. `SIWELoginForm` and "back button"
Depends on D6639
Test Plan: Things continue to work as expected.
Reviewers: ashoat, tomek | [
{
"change_type": "MODIFY",
"old_path": "web/account/log-in-form.react.js",
"new_path": "web/account/log-in-form.react.js",
"diff": "@@ -4,8 +4,6 @@ import { useConnectModal } from '@rainbow-me/rainbowkit';\nimport * as React from 'react';\nimport { useSigner } from 'wagmi';\n-import { isDev } from 'lib/utils/dev-utils';\n-\nimport OrBreak from '../components/or-break.react.js';\nimport css from './log-in-form.css';\nimport SIWEButton from './siwe-button.react.js';\n@@ -30,23 +28,10 @@ function LoginForm(): React.Node {\nsetSIWEAuthFlowSelected(false);\n}, []);\n- let siweLoginForm, siweButton;\n- if (isDev && siweAuthFlowSelected && signer) {\n- siweLoginForm = <SIWELoginForm cancelSIWEAuthFlow={cancelSIWEAuthFlow} />;\n- } else if (isDev) {\n- siweButton = <SIWEButton onSIWEButtonClick={onSIWEButtonClick} />;\n- }\n-\n- if (siweLoginForm) {\n- return <div className={css.modal_body}>{siweLoginForm}</div>;\n- }\n-\n- if (siweButton) {\n+ if (siweAuthFlowSelected && signer) {\nreturn (\n<div className={css.modal_body}>\n- <TraditionalLoginForm />\n- <OrBreak />\n- {siweButton}\n+ <SIWELoginForm cancelSIWEAuthFlow={cancelSIWEAuthFlow} />\n</div>\n);\n}\n@@ -54,6 +39,8 @@ function LoginForm(): React.Node {\nreturn (\n<div className={css.modal_body}>\n<TraditionalLoginForm />\n+ <OrBreak />\n+ <SIWEButton onSIWEButtonClick={onSIWEButtonClick} />\n</div>\n);\n}\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [web] Flip the switch to enable SIWE on `web`
Summary:
Remove the `isDev` checks from `LoginForm` component and display either
A. `TraditionalLoginForm` and `SIWEButton` or
B. `SIWELoginForm` and "back button"
---
Depends on D6639
Test Plan: Things continue to work as expected.
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6640 |
129,184 | 07.02.2023 14:01:06 | 18,000 | d504818cfdc2d5e97c19980e4df0a57103e9a787 | [yarn] Introduce `yarn flow-all` to run `flow` in all workspaces
Summary:
A. This is just kind of useful
B. It allows us to reduce the length of the `flow` commands in the Buildkite ESLint/Flow/Jest workflow
Test Plan: `yarn flow-all` works as expected
Reviewers: ashoat, tomek | [
{
"change_type": "MODIFY",
"old_path": ".buildkite/eslint_flow_jest.yml",
"new_path": ".buildkite/eslint_flow_jest.yml",
"diff": "steps:\n- label: ':eslint: :jest: ESLint & Flow & Jest'\n- command: '(pkill flow || true) && curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . /root/.cargo/env && apt update && apt install -y cmake && yarn cleaninstall --frozen-lockfile --skip-optional --network-timeout 180000 && yarn eslint --max-warnings=0 && yarn workspace lib flow && yarn workspace web flow && yarn workspace landing flow && yarn workspace native flow && yarn workspace keyserver flow && yarn workspace desktop flow && yarn workspace electron-update-server flow && yarn workspace lib test && yarn workspace keyserver test'\n+ command: '(pkill flow || true) && curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . /root/.cargo/env && apt update && apt install -y cmake && yarn cleaninstall --frozen-lockfile --skip-optional --network-timeout 180000 && yarn eslint --max-warnings=0 && yarn flow-all && yarn workspace lib test && yarn workspace keyserver test'\nretry:\nautomatic: true\nplugins:\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"terraform-pre-commit\": \"./scripts/terraform_pre_commit.sh\",\n\"prepare\": \"husky install\",\n\"arcpatch\": \"git pull --all --tags && arc patch\",\n- \"postinstall\": \"bash ./postinstall.sh\"\n+ \"postinstall\": \"bash ./postinstall.sh\",\n+ \"flow-all\": \"yarn workspace lib flow && yarn workspace web flow && yarn workspace landing flow && yarn workspace native flow && yarn workspace keyserver flow && yarn workspace desktop flow && yarn workspace electron-update-server flow\"\n},\n\"devDependencies\": {\n\"babel-eslint\": \"^10.1.0\",\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [yarn] Introduce `yarn flow-all` to run `flow` in all workspaces
Summary:
A. This is just kind of useful
B. It allows us to reduce the length of the `flow` commands in the Buildkite ESLint/Flow/Jest workflow
Test Plan: `yarn flow-all` works as expected
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6649 |
129,184 | 07.02.2023 14:05:30 | 18,000 | c218ddb68fac8e219e3420d72a8e286cf1590155 | [yarn] Introduce `yarn jest-all` to run `jest` in all workspaces
Summary:
Runs `jest` unit tests in workspaces that were previously being tested in `eslint_flow_jest.yml` workflow.
Reduces length of command in `eslint_flow_jest.yml` workflow and may be generally helpful.
Test Plan:
Works as expected:
Reviewers: ashoat, tomek | [
{
"change_type": "MODIFY",
"old_path": ".buildkite/eslint_flow_jest.yml",
"new_path": ".buildkite/eslint_flow_jest.yml",
"diff": "steps:\n- label: ':eslint: :jest: ESLint & Flow & Jest'\n- command: '(pkill flow || true) && curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . /root/.cargo/env && apt update && apt install -y cmake && yarn cleaninstall --frozen-lockfile --skip-optional --network-timeout 180000 && yarn eslint --max-warnings=0 && yarn flow-all && yarn workspace lib test && yarn workspace keyserver test'\n+ command: '(pkill flow || true) && curl --proto \"=https\" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . /root/.cargo/env && apt update && apt install -y cmake && yarn cleaninstall --frozen-lockfile --skip-optional --network-timeout 180000 && yarn eslint --max-warnings=0 && yarn flow-all && yarn jest-all'\nretry:\nautomatic: true\nplugins:\n"
},
{
"change_type": "MODIFY",
"old_path": "package.json",
"new_path": "package.json",
"diff": "\"prepare\": \"husky install\",\n\"arcpatch\": \"git pull --all --tags && arc patch\",\n\"postinstall\": \"bash ./postinstall.sh\",\n- \"flow-all\": \"yarn workspace lib flow && yarn workspace web flow && yarn workspace landing flow && yarn workspace native flow && yarn workspace keyserver flow && yarn workspace desktop flow && yarn workspace electron-update-server flow\"\n+ \"flow-all\": \"yarn workspace lib flow && yarn workspace web flow && yarn workspace landing flow && yarn workspace native flow && yarn workspace keyserver flow && yarn workspace desktop flow && yarn workspace electron-update-server flow\",\n+ \"jest-all\": \"yarn workspace lib test && yarn workspace keyserver test\"\n},\n\"devDependencies\": {\n\"babel-eslint\": \"^10.1.0\",\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [yarn] Introduce `yarn jest-all` to run `jest` in all workspaces
Summary:
Runs `jest` unit tests in workspaces that were previously being tested in `eslint_flow_jest.yml` workflow.
Reduces length of command in `eslint_flow_jest.yml` workflow and may be generally helpful.
Test Plan:
Works as expected:
https://blob.sh/1ce144.png
Reviewers: ashoat, tomek
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D6650 |
129,184 | 07.02.2023 18:42:14 | 18,000 | 5b5dc14ff3932938ef2b59010dacd3eb6981a656 | [native] `codeVersion` -> 187 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -471,8 +471,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 186\n- versionName '1.0.186'\n+ versionCode 187\n+ versionName '1.0.187'\nbuildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\nif (isNewArchitectureEnabled()) {\n// We configure the CMake build only if you decide to opt-in for the New Architecture.\n"
},
{
"change_type": "MODIFY",
"old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{186};\n+ const int codeVersion{187};\nstd::unique_ptr<WorkerThread> cryptoThread;\nCommSecureStore secureStore;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"new_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"diff": "CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\n- CURRENT_PROJECT_VERSION = 186;\n+ CURRENT_PROJECT_VERSION = 187;\nDEBUG_INFORMATION_FORMAT = dwarf;\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.186;\n+ MARKETING_VERSION = 1.0.187;\nMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\nMTL_FAST_MATH = YES;\nOTHER_CFLAGS = (\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\nCOPY_PHASE_STRIP = NO;\n- CURRENT_PROJECT_VERSION = 186;\n+ CURRENT_PROJECT_VERSION = 187;\nDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.186;\n+ MARKETING_VERSION = 1.0.187;\nMTL_FAST_MATH = YES;\nONLY_ACTIVE_ARCH = YES;\nOTHER_CFLAGS = (\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.debug.plist",
"new_path": "native/ios/Comm/Info.debug.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.186</string>\n+ <string>1.0.187</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>186</string>\n+ <string>187</string>\n<key>CFBundleURLTypes</key>\n<array>\n<dict>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.release.plist",
"new_path": "native/ios/Comm/Info.release.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.186</string>\n+ <string>1.0.187</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>186</string>\n+ <string>187</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>rainbow</string>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] `codeVersion` -> 187 |
129,184 | 07.02.2023 18:46:39 | 18,000 | b51ab254ec88f0d0228f1be75149cc4285a8eac4 | [native] `codeVersion` -> 188 | [
{
"change_type": "MODIFY",
"old_path": "native/android/app/build.gradle",
"new_path": "native/android/app/build.gradle",
"diff": "@@ -471,8 +471,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 187\n- versionName '1.0.187'\n+ versionCode 188\n+ versionName '1.0.188'\nbuildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\nif (isNewArchitectureEnabled()) {\n// We configure the CMake build only if you decide to opt-in for the New Architecture.\n"
},
{
"change_type": "MODIFY",
"old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h",
"diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{187};\n+ const int codeVersion{188};\nstd::unique_ptr<WorkerThread> cryptoThread;\nCommSecureStore secureStore;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"new_path": "native/ios/Comm.xcodeproj/project.pbxproj",
"diff": "CODE_SIGN_IDENTITY = \"Apple Development\";\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\n- CURRENT_PROJECT_VERSION = 187;\n+ CURRENT_PROJECT_VERSION = 188;\nDEBUG_INFORMATION_FORMAT = dwarf;\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.187;\n+ MARKETING_VERSION = 1.0.188;\nMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\nMTL_FAST_MATH = YES;\nOTHER_CFLAGS = (\n\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\nCODE_SIGN_STYLE = Automatic;\nCOPY_PHASE_STRIP = NO;\n- CURRENT_PROJECT_VERSION = 187;\n+ CURRENT_PROJECT_VERSION = 188;\nDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\nDEVELOPMENT_TEAM = H98Y8MH53M;\n\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = arm64;\n\"@executable_path/Frameworks\",\n\"@executable_path/../../Frameworks\",\n);\n- MARKETING_VERSION = 1.0.187;\n+ MARKETING_VERSION = 1.0.188;\nMTL_FAST_MATH = YES;\nONLY_ACTIVE_ARCH = YES;\nOTHER_CFLAGS = (\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.debug.plist",
"new_path": "native/ios/Comm/Info.debug.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.187</string>\n+ <string>1.0.188</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>187</string>\n+ <string>188</string>\n<key>CFBundleURLTypes</key>\n<array>\n<dict>\n"
},
{
"change_type": "MODIFY",
"old_path": "native/ios/Comm/Info.release.plist",
"new_path": "native/ios/Comm/Info.release.plist",
"diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.187</string>\n+ <string>1.0.188</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>187</string>\n+ <string>188</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>rainbow</string>\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] `codeVersion` -> 188 |
129,198 | 08.02.2023 11:58:53 | -3,600 | 40596931e8c846d2efd6863fb8bf95d1c4dfff9a | [native] Fixed crash when logging out while thread opened
Summary: Removed invariant, which was causing the error, and checked null values in measureMessages method.
Test Plan: Checked logging out while there was opened the chat window, not it doesn't throw an error.
Reviewers: tomek
Subscribers: ashoat, atul | [
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-context-provider.react.js",
"new_path": "native/chat/chat-context-provider.react.js",
"diff": "@@ -36,7 +36,7 @@ function ChatContextProvider(props: Props): React.Node {\nconst measureMessages = React.useCallback(\n(\n- messages: $ReadOnlyArray<ChatMessageItem>,\n+ messages: ?$ReadOnlyArray<ChatMessageItem>,\nthreadInfo: ?ThreadInfo,\nonMessagesMeasured: ($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,\nmeasurerID: number,\n@@ -48,6 +48,10 @@ function ChatContextProvider(props: Props): React.Node {\nreturn;\n}\n+ if (!messages) {\n+ return;\n+ }\n+\nconst measureCallback = (\nmessagesWithHeight: $ReadOnlyArray<ChatMessageItemWithHeight>,\nnewMeasuredHeights: $ReadOnlyMap<string, number>,\n@@ -88,7 +92,7 @@ function ChatContextProvider(props: Props): React.Node {\nconst measurerID = nextMeasurerID.current++;\nreturn {\nmeasure: (\n- messages: $ReadOnlyArray<ChatMessageItem>,\n+ messages: ?$ReadOnlyArray<ChatMessageItem>,\nthreadInfo: ?ThreadInfo,\nonMessagesMeasured: (\n$ReadOnlyArray<ChatMessageItemWithHeight>,\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/chat-context.js",
"new_path": "native/chat/chat-context.js",
"diff": "@@ -10,7 +10,7 @@ import type { ThreadInfo } from 'lib/types/thread-types';\nimport type { ChatMessageItemWithHeight } from '../types/chat-types';\nexport type MessagesMeasurer = (\n- $ReadOnlyArray<ChatMessageItem>,\n+ ?$ReadOnlyArray<ChatMessageItem>,\n?ThreadInfo,\n($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,\n) => void;\n"
},
{
"change_type": "MODIFY",
"old_path": "native/chat/message-list-container.react.js",
"new_path": "native/chat/message-list-container.react.js",
"diff": "@@ -58,7 +58,7 @@ type Props = {\n+userSearchResults: $ReadOnlyArray<UserListItem>,\n+threadInfo: ThreadInfo,\n+genesisThreadInfo: ?ThreadInfo,\n- +messageListData: $ReadOnlyArray<ChatMessageItem>,\n+ +messageListData: ?$ReadOnlyArray<ChatMessageItem>,\n+colors: Colors,\n+styles: typeof unboundStyles,\n// withOverlayContext\n@@ -327,10 +327,6 @@ const ConnectedMessageListContainer: React.ComponentType<BaseProps> = React.memo\nuserInfoInputArray,\nthreadInfo,\n});\n- invariant(\n- messageListData,\n- 'messageListData must be specified in messageListContainer',\n- );\nconst colors = useColors();\nconst styles = useStyles(unboundStyles);\nconst overlayContext = React.useContext(OverlayContext);\n"
}
] | JavaScript | BSD 3-Clause New or Revised License | comme2e/comm | [native] Fixed crash when logging out while thread opened
Summary: Removed invariant, which was causing the error, and checked null values in measureMessages method.
Test Plan: Checked logging out while there was opened the chat window, not it doesn't throw an error.
Reviewers: tomek
Reviewed By: tomek
Subscribers: ashoat, atul
Differential Revision: https://phab.comm.dev/D6665 |
708,309 | 27.09.2017 21:49:37 | 14,400 | 423e5d2adb27106c052ab9855c71cf6fe5ba69f2 | added flushCache function | [
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Router.swift",
"new_path": "Sources/Routing/Router.swift",
"diff": "@@ -26,6 +26,26 @@ public class Router {\nprivate var _cache: [String: Responder?] = [:]\nprivate var _cacheLock = NSLock()\n+ /// Removes the cached Responder for a given Request.\n+ /// If there is no cached Responder, returns nil.\n+ ///\n+ /// NOTE: If you do not register a new Responder for the\n+ /// Request, the old Responder will be invoked on a subsequent\n+ /// Request and re-cached. I.E. this function does not prune\n+ /// the Branch.\n+ @discardableResult\n+ public func flushCache(for request: Request) -> Responder? {\n+ _cacheLock.lock()\n+ let maybeCached = _cache.removeValue(forKey: request.routeKey)\n+ _cacheLock.unlock()\n+\n+ if let cached = maybeCached {\n+ return cached\n+ } else {\n+ return nil\n+ }\n+ }\n+\n/// Routes an incoming request\n/// the request will be populated with any found parameters (aka slugs).\n///\n"
}
] | Swift | MIT License | vapor/routing-kit | added flushCache function |
708,309 | 28.09.2017 20:35:13 | 14,400 | 1a8cebd29162cacbda96e015a10b269c74182b15 | added function to flush entire cache | [
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Router.swift",
"new_path": "Sources/Routing/Router.swift",
"diff": "@@ -26,12 +26,20 @@ public class Router {\nprivate var _cache: [String: Responder?] = [:]\nprivate var _cacheLock = NSLock()\n+ /// Removes all entries from this router's cache.\n+ ///\n+ public func flushCache() {\n+ _cacheLock.lock()\n+ _cache.removeAll()\n+ _cacheLock.unlock()\n+ }\n+\n/// Removes the cached Responder for a given Request.\n/// If there is no cached Responder, returns nil.\n///\n/// NOTE: If you do not register a new Responder for the\n/// Request, the old Responder will be invoked on a subsequent\n- /// Request and re-cached. I.E. this function does not prune\n+ /// Request and re-cached. I.e. this function does not prune\n/// the Branch.\n@discardableResult\npublic func flushCache(for request: Request) -> Responder? {\n"
}
] | Swift | MIT License | vapor/routing-kit | added function to flush entire cache |
708,308 | 06.12.2017 14:40:57 | -3,600 | e1694a6bc901e1b2a2cabe79fc3cd27de816ed41 | Remove characters because of deprecation | [
{
"change_type": "MODIFY",
"old_path": "Sources/Branches/Branch.swift",
"new_path": "Sources/Branches/Branch.swift",
"diff": "@@ -47,7 +47,7 @@ public class Branch<Output> { // TODO: Rename Context\npublic private(set) lazy var slugIndexes: [(key: String, idx: Int)] = {\nvar params = self.parent?.slugIndexes ?? []\nguard self.name.hasPrefix(\":\") else { return params }\n- let characters = self.name.characters.dropFirst()\n+ let characters = self.name.toCharacterSequence().dropFirst()\nlet key = String(characters)\nparams.append((key, self.depth - 1))\nreturn params\n@@ -198,3 +198,15 @@ extension Branch {\nbranch.parent = self\n}\n}\n+\n+extension String {\n+ #if swift(>=4.0)\n+ internal func toCharacterSequence() -> String {\n+ return self\n+ }\n+ #else\n+ internal func toCharacterSequence() -> CharacterView {\n+ return self.characters\n+ }\n+ #endif\n+}\n"
}
] | Swift | MIT License | vapor/routing-kit | Remove characters because of deprecation |
708,319 | 24.04.2018 08:45:50 | 14,400 | 991da6674542c55639c6c8c31400c7156458f122 | Moved .anything to .catchall and added .anything for asterisk in the middle of routes. | [
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Register/PathComponent.swift",
"new_path": "Sources/Routing/Register/PathComponent.swift",
"diff": "@@ -7,9 +7,12 @@ public enum PathComponent: ExpressibleByStringLiteral {\n/// A dynamic parameter component.\ncase parameter(String)\n+ /// This route will match everything that is not in other routes\n+ case anything\n+\n/// This route will match and discard any number of constant components after\n/// this anything component.\n- case anything\n+ case catchall\n/// See `ExpressibleByStringLiteral`.\npublic init(stringLiteral value: String) {\n@@ -28,6 +31,7 @@ extension Array where Element == PathComponent {\ncase .constant(let s): return s\ncase .parameter(let p): return \":\\(p)\"\ncase .anything: return \"*\"\n+ case .catchall: return \"*\"\n}\n}.joined(separator: \"/\")\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Routing/RouterNode.swift",
"new_path": "Sources/Routing/Routing/RouterNode.swift",
"diff": "@@ -13,6 +13,9 @@ final class RouterNode<Output> {\n/// This node should not have any child nodes.\nvar catchall: RouterNode<Output>?\n+ /// Anything child node, if one exists.\n+ var anything: RouterNode<Output>?\n+\n/// This node's output\nvar output: Output?\n@@ -60,15 +63,26 @@ final class RouterNode<Output> {\nself.parameter = node\n}\nreturn node\n- case .anything:\n+ case .catchall:\nlet node: RouterNode<Output>\nif let fallback = self.catchall {\nnode = fallback\n- } else {\n+ }\n+ else {\nnode = RouterNode<Output>(value: Data([.asterisk]))\nself.catchall = node\n}\nreturn node\n+ case .anything:\n+ let node: RouterNode<Output>\n+ if (self.anything == nil) {\n+ node = RouterNode<Output>(value: Data([.asterisk]))\n+ self.anything = node\n+ }\n+ else {\n+ node = self.anything!\n+ }\n+ return node\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Routing/TrieRouter.swift",
"new_path": "Sources/Routing/Routing/TrieRouter.swift",
"diff": "@@ -41,6 +41,8 @@ public final class TrieRouter<Output> {\n// start at the root of the trie branch\nvar current = root\n+ print(\"adding:\",route.path)\n+\n// for each dynamic path in the route get the appropriate\n// child generating a new one if necessary\nfor component in route.path {\n@@ -93,9 +95,15 @@ public final class TrieRouter<Output> {\ncontinue search\n}\n+ // check for anythings\n+ if let anything = currentNode.anything {\n+ currentNode = anything\n+ continue search\n+ }\n+\n// no constants or dynamic members, check for catchall\nif let catchall = currentNode.catchall {\n- // there is a catchall, short-circuit to its output\n+ // there is a catchall and it is final, short-circuit to its output\nreturn catchall.output\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "Tests/RoutingTests/RouterTests.swift",
"new_path": "Tests/RoutingTests/RouterTests.swift",
"diff": "@@ -40,7 +40,8 @@ class RouterTests: XCTestCase {\nlet route1 = Route<Int>(path: [.constant(\"b\"), .parameter(\"1\"), .anything], output: 1)\nlet route2 = Route<Int>(path: [.constant(\"c\"), .parameter(\"1\"), .parameter(\"2\"), .anything], output: 2)\nlet route3 = Route<Int>(path: [.constant(\"d\"), .parameter(\"1\"), .parameter(\"2\")], output: 3)\n- let route4 = Route<Int>(path: [.constant(\"e\"), .parameter(\"1\"), .anything], output: 4)\n+ let route4 = Route<Int>(path: [.constant(\"e\"), .parameter(\"1\"), .catchall], output: 4)\n+ let route5 = Route<Int>(path: [.anything, .constant(\"e\"), .parameter(\"1\")], output: 5)\nlet router = TrieRouter<Int>()\nrouter.register(route: route0)\n@@ -48,6 +49,7 @@ class RouterTests: XCTestCase {\nrouter.register(route: route2)\nrouter.register(route: route3)\nrouter.register(route: route4)\n+ router.register(route: route5)\nvar params = Parameters()\nXCTAssertEqual(router.route(path: [\"a\", \"b\"], parameters: ¶ms), 0)\n@@ -64,6 +66,9 @@ class RouterTests: XCTestCase {\nXCTAssertNil(router.route(path: [\"d\", \"a\", \"b\", \"c\"], parameters: ¶ms))\nXCTAssertNil(router.route(path: [\"d\", \"a\"], parameters: ¶ms))\nXCTAssertEqual(router.route(path: [\"e\", \"1\", \"b\", \"a\"], parameters: ¶ms), 4)\n+ XCTAssertEqual(router.route(path: [\"f\", \"e\", \"1\"], parameters: ¶ms), 5)\n+ XCTAssertEqual(router.route(path: [\"g\", \"e\", \"1\"], parameters: ¶ms), 5)\n+ XCTAssertEqual(router.route(path: [\"g\", \"e\", \"1\"], parameters: ¶ms), 5)\n}\nfunc testRouterSuffixes() throws {\n"
}
] | Swift | MIT License | vapor/routing-kit | Moved .anything to .catchall and added .anything for asterisk in the middle of routes. |
708,319 | 25.04.2018 17:18:22 | 14,400 | b9cfea87bae9f418adc7d52c0dcd1d59699a897b | Rename .catchall to .all and .anything to .any. | [
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Register/PathComponent.swift",
"new_path": "Sources/Routing/Register/PathComponent.swift",
"diff": "@@ -8,11 +8,11 @@ public enum PathComponent: ExpressibleByStringLiteral {\ncase parameter(String)\n/// This route will match everything that is not in other routes\n- case anything\n+ case any\n/// This route will match and discard any number of constant components after\n/// this anything component.\n- case catchall\n+ case all\n/// See `ExpressibleByStringLiteral`.\npublic init(stringLiteral value: String) {\n@@ -21,7 +21,9 @@ public enum PathComponent: ExpressibleByStringLiteral {\n}\n/// Shortcut for accessing `PathComponent.anything`.\n-public let any: PathComponent = .anything\n+public let any: PathComponent = .any\n+public let all: PathComponent = .all\n+\nextension Array where Element == PathComponent {\n/// Creates a readable representation of this array of `PathComponent`.\n@@ -30,8 +32,8 @@ extension Array where Element == PathComponent {\nswitch $0 {\ncase .constant(let s): return s\ncase .parameter(let p): return \":\\(p)\"\n- case .anything: return \"*\"\n- case .catchall: return \"*\"\n+ case .any: return \":\"\n+ case .all: return \"*\"\n}\n}.joined(separator: \"/\")\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Routing/RouterNode.swift",
"new_path": "Sources/Routing/Routing/RouterNode.swift",
"diff": "@@ -63,7 +63,7 @@ final class RouterNode<Output> {\nself.parameter = node\n}\nreturn node\n- case .catchall:\n+ case .all:\nlet node: RouterNode<Output>\nif let fallback = self.catchall {\nnode = fallback\n@@ -73,7 +73,7 @@ final class RouterNode<Output> {\nself.catchall = node\n}\nreturn node\n- case .anything:\n+ case .any:\nlet node: RouterNode<Output>\nif (self.anything == nil) {\nnode = RouterNode<Output>(value: Data([.asterisk]))\n"
},
{
"change_type": "MODIFY",
"old_path": "Tests/RoutingTests/RouterTests.swift",
"new_path": "Tests/RoutingTests/RouterTests.swift",
"diff": "@@ -36,12 +36,12 @@ class RouterTests: XCTestCase {\n}\nfunc testAnyRouting() throws {\n- let route0 = Route<Int>(path: [.constant(\"a\"), .anything], output: 0)\n- let route1 = Route<Int>(path: [.constant(\"b\"), .parameter(\"1\"), .anything], output: 1)\n- let route2 = Route<Int>(path: [.constant(\"c\"), .parameter(\"1\"), .parameter(\"2\"), .anything], output: 2)\n+ let route0 = Route<Int>(path: [.constant(\"a\"), .any], output: 0)\n+ let route1 = Route<Int>(path: [.constant(\"b\"), .parameter(\"1\"), .any], output: 1)\n+ let route2 = Route<Int>(path: [.constant(\"c\"), .parameter(\"1\"), .parameter(\"2\"), .any], output: 2)\nlet route3 = Route<Int>(path: [.constant(\"d\"), .parameter(\"1\"), .parameter(\"2\")], output: 3)\n- let route4 = Route<Int>(path: [.constant(\"e\"), .parameter(\"1\"), .catchall], output: 4)\n- let route5 = Route<Int>(path: [.anything, .constant(\"e\"), .parameter(\"1\")], output: 5)\n+ let route4 = Route<Int>(path: [.constant(\"e\"), .parameter(\"1\"), .all], output: 4)\n+ let route5 = Route<Int>(path: [.any, .constant(\"e\"), .parameter(\"1\")], output: 5)\nlet router = TrieRouter<Int>()\nrouter.register(route: route0)\n"
}
] | Swift | MIT License | vapor/routing-kit | Rename .catchall to .all and .anything to .any. |
708,325 | 06.10.2018 14:20:56 | 25,200 | d6a79345e60cfa0d6b3f402750fec2de46fe2ecc | Update README.md
update chat badge | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "<a href=\"https://docs.vapor.codes/3.0/\">\n<img src=\"http://img.shields.io/badge/read_the-docs-2196f3.svg\" alt=\"Documentation\">\n</a>\n- <a href=\"http://vapor.team\">\n- <img src=\"http://vapor.team/badge.svg\" alt=\"Slack Team\">\n+ <a href=\"https://discord.gg/vapor\">\n+ <img src=\"https://img.shields.io/discord/431917998102675485.svg\" alt=\"Team Chat\">\n</a>\n<a href=\"LICENSE\">\n<img src=\"http://img.shields.io/badge/license-MIT-brightgreen.svg\" alt=\"MIT License\">\n"
}
] | Swift | MIT License | vapor/routing-kit | Update README.md
update chat badge |
708,325 | 29.12.2018 15:03:16 | 28,800 | 8584132d60632a3bed854cfca61e7b7983474d1a | Update README.md
revert URL to vapor.team | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "<a href=\"https://docs.vapor.codes/3.0/\">\n<img src=\"http://img.shields.io/badge/read_the-docs-2196f3.svg\" alt=\"Documentation\">\n</a>\n- <a href=\"https://discord.gg/vapor\">\n+ <a href=\"http://vaport.team\">\n<img src=\"https://img.shields.io/discord/431917998102675485.svg\" alt=\"Team Chat\">\n</a>\n<a href=\"LICENSE\">\n"
}
] | Swift | MIT License | vapor/routing-kit | Update README.md
revert URL to vapor.team |
708,325 | 29.12.2018 15:04:31 | 28,800 | 217d8d3a9258c40afc7344792d4b57582f1f48bd | Update README.md
cripes, fix typo | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "<a href=\"https://docs.vapor.codes/3.0/\">\n<img src=\"http://img.shields.io/badge/read_the-docs-2196f3.svg\" alt=\"Documentation\">\n</a>\n- <a href=\"http://vaport.team\">\n+ <a href=\"http://vapor.team\">\n<img src=\"https://img.shields.io/discord/431917998102675485.svg\" alt=\"Team Chat\">\n</a>\n<a href=\"LICENSE\">\n"
}
] | Swift | MIT License | vapor/routing-kit | Update README.md
cripes, fix typo |
708,324 | 16.01.2019 17:46:44 | 28,800 | 8e64a3ec32da2322198d7215b25bd925f81bf150 | Remove unused doc comment | [
{
"change_type": "MODIFY",
"old_path": "Sources/Routing/Parameter/Parameter.swift",
"new_path": "Sources/Routing/Parameter/Parameter.swift",
"diff": "@@ -29,7 +29,6 @@ public protocol Parameter {\n/// - parameters:\n/// - parameter: Concrete `String` that has been supplied in the URL in the position\n/// specified by this dynamic parameter.\n- /// - container: Reference to a `Container` for creating services\n/// - returns: An instance of the `ResolvedParameter` type if one could be created.\n/// - throws: Throws an error if a `ResolvedParameter` could not be created.\nstatic func resolveParameter(_ parameter: String) throws -> ResolvedParameter\n"
}
] | Swift | MIT License | vapor/routing-kit | Remove unused doc comment |
708,324 | 17.01.2019 09:12:33 | 28,800 | 7e56d2916a1543a1eabe633ecf914bc11f8403d0 | Update maintainers list format | [
{
"change_type": "MODIFY",
"old_path": "Docs/contributing.md",
"new_path": "Docs/contributing.md",
"diff": "@@ -30,9 +30,9 @@ existing code to stop compiling _must_ wait until the next major version to be i\nCode that is only additive and will not break any existing code can be included in the next minor release.\n## Maintainers\n+- [@twof](https://github.com/twof)\n-Each repo under the Vapor organization has at least one [volunteer maintainer.](maintainers.md) [vapor/routing](https://github.com/vapor/routing) is\n-currently maintained by [@twof](https://github.com/twof).\n+Each repo under the Vapor organization has at least one [volunteer maintainer.](maintainers.md)\n## Extras\n"
}
] | Swift | MIT License | vapor/routing-kit | Update maintainers list format |
708,324 | 16.03.2019 10:29:17 | 25,200 | 9967b3cbd857b1c71faf6e8fb642dd9e12b37a1f | 10x'd test iterations | [
{
"change_type": "MODIFY",
"old_path": "Tests/RoutingKitTests/RouterPerformanceTests.swift",
"new_path": "Tests/RoutingKitTests/RouterPerformanceTests.swift",
"diff": "@@ -14,7 +14,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"a\", \"42\"], parameters: ¶ms)\n}\n}\n@@ -32,7 +32,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"a\", \"42\"], parameters: ¶ms)\n}\n}\n@@ -50,7 +50,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"aaaaaaaa\", \"42\"], parameters: ¶ms)\n}\n}\n@@ -68,7 +68,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"aaaaaaag\", \"42\"], parameters: ¶ms)\n}\n}\n@@ -85,7 +85,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"a\"], parameters: ¶ms)\n}\n}\n@@ -102,7 +102,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"a\"], parameters: ¶ms)\n}\n}\n@@ -120,7 +120,7 @@ public final class RouterPerformanceTests: XCTestCase {\nmeasure {\nvar params = Parameters()\n- for _ in 0..<100_000 {\n+ for _ in 0..<1_000_000 {\n_ = router.route(path: [\"baaaaaaaaaaaaa\"], parameters: ¶ms)\n}\n}\n"
}
] | Swift | MIT License | vapor/routing-kit | 10x'd test iterations (#71) |
708,326 | 27.02.2020 19:04:56 | -3,600 | 9eccd8152a66db98c188e74242c686971a007211 | Add pathComponents property to the String | [
{
"change_type": "MODIFY",
"old_path": "Sources/RoutingKit/PathComponent.swift",
"new_path": "Sources/RoutingKit/PathComponent.swift",
"diff": "@@ -54,6 +54,13 @@ public enum PathComponent: ExpressibleByStringLiteral, CustomStringConvertible {\n}\n}\n+extension String {\n+ /// Converts a string into `[PathComponent]`.\n+ public var pathComponents: [PathComponent] {\n+ return self.split(separator: \"/\").map { .init(stringLiteral: .init($0)) }\n+ }\n+}\n+\nextension Array where Element == PathComponent {\n/// Converts an array of `PathComponent` into a readable path string.\n///\n"
}
] | Swift | MIT License | vapor/routing-kit | Add pathComponents property to the String (#85) |
708,323 | 16.11.2020 15:09:38 | 0 | 7b6af0e8edcf77437734a05404200c2c54359b64 | Migrate funding to the file in the central org repo | [
{
"change_type": "DELETE",
"old_path": ".github/FUNDING.yml",
"new_path": null,
"diff": "-github: [tanner0101] # loganwright, joscdk\n-open_collective: vapor\n"
}
] | Swift | MIT License | vapor/routing-kit | Migrate funding to the file in the central org repo (#104) |
708,323 | 13.04.2021 14:54:29 | -3,600 | 90ae246faf595cf8d90042c8dc96a0d17990d95b | Fix inline docs to remove leading `/` and use `Sequence` instead of `Array` | [
{
"change_type": "MODIFY",
"old_path": "Sources/RoutingKit/PathComponent.swift",
"new_path": "Sources/RoutingKit/PathComponent.swift",
"diff": "@@ -63,10 +63,10 @@ extension String {\n}\n}\n-extension Array where Element == PathComponent {\n+extension Sequence where Element == PathComponent {\n/// Converts an array of `PathComponent` into a readable path string.\n///\n- /// /galaxies/:galaxyID/planets\n+ /// galaxies/:galaxyID/planets\n///\npublic var string: String {\nreturn self.map(\\.description).joined(separator: \"/\")\n"
}
] | Swift | MIT License | vapor/routing-kit | Fix inline docs to remove leading `/` and use `Sequence` instead of `Array` (#107) |
708,321 | 11.05.2021 11:10:09 | 14,400 | a0801a36a6ad501d5ad6285cbcd4774de6b0a734 | Add `AnyRouter` type-eraser | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "Sources/RoutingKit/AnyRouter.swift",
"diff": "+/// A router that performs type erasure by wrapping another router.\n+public struct AnyRouter<Output>: Router {\n+ private let box: _AnyRouterBase<Output>\n+\n+ public init<Router>(_ base: Router) where Router: RoutingKit.Router, Router.Output == Output {\n+ self.box = _AnyRouterBox(base)\n+ }\n+\n+ public func register(_ output: Output, at path: [PathComponent]) {\n+ box.register(output, at: path)\n+ }\n+\n+ public func route(path: [String], parameters: inout Parameters) -> Output? {\n+ box.route(path: path, parameters: ¶meters)\n+ }\n+}\n+\n+extension Router {\n+ /// Wraps this router with a type eraser.\n+ public func eraseToAnyRouter() -> AnyRouter<Output> {\n+ return AnyRouter(self)\n+ }\n+}\n+\n+private class _AnyRouterBase<Output>: Router {\n+ init() {\n+ guard type(of: self) != _AnyRouterBase.self else {\n+ fatalError(\"_AnyRouterBase<Output> instances cannot be created. Subclass instead.\")\n+ }\n+ }\n+\n+ func register(_ output: Output, at path: [PathComponent]) {\n+ fatalError(\"Must be overridden\")\n+ }\n+\n+ func route(path: [String], parameters: inout Parameters) -> Output? {\n+ fatalError(\"Must be overridden\")\n+ }\n+}\n+\n+private final class _AnyRouterBox<Concrete>: _AnyRouterBase<Concrete.Output> where Concrete: Router {\n+ private var concrete: Concrete\n+\n+ init(_ concrete: Concrete) {\n+ self.concrete = concrete\n+ }\n+\n+ override func register(_ output: Output, at path: [PathComponent]) {\n+ concrete.register(output, at: path)\n+ }\n+\n+ override func route(path: [String], parameters: inout Parameters) -> Concrete.Output? {\n+ concrete.route(path: path, parameters: ¶meters)\n+ }\n+}\n"
}
] | Swift | MIT License | vapor/routing-kit | Add `AnyRouter` type-eraser (#109) |
708,323 | 16.05.2022 08:42:31 | -7,200 | e229a7aae0a51b55b2cb04dec28a12176bbda979 | Update Supported Swift Versions | [
{
"change_type": "MODIFY",
"old_path": ".github/workflows/test.yml",
"new_path": ".github/workflows/test.yml",
"diff": "@@ -18,7 +18,7 @@ jobs:\nupstream-check:\nruns-on: ubuntu-latest\n- container: swift:5.5-focal\n+ container: swift:5.6-focal\nsteps:\n- name: Check out self\nuses: actions/checkout@v2\n@@ -32,4 +32,4 @@ jobs:\n- name: Use local package\nrun: swift package --package-path vapor edit routing-kit --path routing-kit\n- name: Run tests\n- run: swift test --package-path vapor --enable-test-discovery\n+ run: swift test --package-path vapor\n"
},
{
"change_type": "MODIFY",
"old_path": "Package.swift",
"new_path": "Package.swift",
"diff": "-// swift-tools-version:5.2\n+// swift-tools-version:5.4\nimport PackageDescription\nlet package = Package(\n"
}
] | Swift | MIT License | vapor/routing-kit | Update Supported Swift Versions (#115) |
652,323 | 02.12.2017 23:37:47 | -10,800 | eea4c9c55a01df00e5518ee497cc086ac5e163e0 | fix ItemController template | [
{
"change_type": "MODIFY",
"old_path": "templates/file/surf/ItemController/globals.xml.ftl",
"new_path": "templates/file/surf/ItemController/globals.xml.ftl",
"diff": "<global id=\"nameParam\" value=\"${extractLetters(nameTypeData?lower_case)}\" />\n<global id=\"defPostfixController\" value=\"ItemController\" />\n- <global id=\"ktOrJavaExt\" type=\"string\" value=\"${generateKotlin?string('kt','java')}\" />\n</globals>\n"
},
{
"change_type": "MODIFY",
"old_path": "templates/file/surf/ItemController/recipe.xml.ftl",
"new_path": "templates/file/surf/ItemController/recipe.xml.ftl",
"diff": "<#import \"root://activities/common/kotlin_macros.ftl\" as kt>\n<recipe>\n<@kt.addAllKotlinDependencies />\n- <instantiate from=\"src/app_package/Controller.${ktOrJavaExt}.ftl\"\n- to=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.${ktOrJavaExt}\" />\n- <open file=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.${ktOrJavaExt}\" />\n+\n+ <#if generateKotlin>\n+ <instantiate from=\"src/app_package/Controller.kt.ftl\"\n+ to=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.kt\" />\n+ <open file=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.kt\" />\n+ <#else>\n+ <instantiate from=\"src/app_package/Controller.java.ftl\"\n+ to=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.java\" />\n+ <open file=\"${escapeXmlAttribute(srcOut)}/${nameController}${defPostfixController}.java\" />\n+ </#if>\n+\n<#if generateLayout>\n<instantiate from=\"res/layout/layout.xml.ftl\"\nto=\"${escapeXmlAttribute(resOut)}/layout/${nameRes}.xml\" />\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix ItemController template |
652,304 | 09.01.2018 21:25:28 | -10,800 | 1308f18b14675b25ce7ba79da37b397a1c55ef57 | artifactory deploy | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\napply from: 'config.gradle'\n+apply plugin: 'com.jfrog.artifactory'\nbuildscript {\nrepositories {\n@@ -9,6 +10,7 @@ buildscript {\ndependencies {\nclasspath 'com.android.tools.build:gradle:3.0.1'\n+ classpath \"org.jfrog.buildinfo:build-info-extractor-gradle:latest.release\"\n}\n}\n@@ -22,3 +24,16 @@ allprojects {\ntask clean(type: Delete) {\ndelete rootProject.buildDir\n}\n+\n+\n+artifactory {\n+ contextUrl = 'http://artifactory.surfstudio.ru/artifactory'\n+\n+ publish {\n+ repository {\n+ repoKey = \"libs-release-local\"\n+ username = \"build\"\n+ password = \"T4eMKUFL4HQabI_qn7N2\"\n+ }\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "core/build.gradle",
"new_path": "core/build.gradle",
"diff": "apply plugin: 'com.android.library'\n-\n+apply plugin: 'com.jfrog.artifactory'\n+apply plugin: 'maven-publish'\ndef config = rootProject.extensions.getByName(\"ext\")\n@@ -16,8 +17,8 @@ android {\ndefaultConfig {\nminSdkVersion config[\"minSdkVersion\"]\ntargetSdkVersion config[\"targetSdkVersion\"]\n- versionCode 1\n- versionName \"0.1\"\n+ versionCode config[\"versionCode\"]\n+ versionName config[\"versionName\"]\ntestInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n}\n@@ -85,7 +86,6 @@ dependencies {\ncompileOnly \"org.projectlombok:lombok:${lombokVersion}\"\ncompileOnly \"javax.annotation:jsr250-api:1.0\"\n-\n//main\napi \"com.agna.ferro:ferro-rx:1.0.2\"\napi \"com.android.support:design:${appcompatVersion}\"\n@@ -112,4 +112,20 @@ dependencies {\n//test\ntestImplementation 'junit:junit:4.12'\n+\n+ publishing {\n+ publications {\n+ aar(MavenPublication) {\n+ groupId = applicationId\n+ version = android.defaultConfig.versionName\n+ artifactId project.getName()\n+ artifact(\"$buildDir/outputs/aar/${project.getName()}-release.aar\")\n+ }\n+ }\n+ }\n+\n+ artifactoryPublish {\n+ publications(publishing.publications.aar)\n+ }\n+\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | artifactory deploy |
652,323 | 26.01.2018 10:03:56 | 0 | e4b446cd3dd2710f37073a3feba97acf7e790924 | bitbucket-pipelines.yml deleted online with Bitbucket | [
{
"change_type": "DELETE",
"old_path": "bitbucket-pipelines.yml",
"new_path": null,
"diff": "-# This is a sample build configuration for Java (Maven).\n-# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.\n-# Only use spaces to indent your .yml configuration.\n-# -----\n-# You can specify a custom docker image from Docker Hub as your build environment.\n-image: java:7\n-pipelines:\n- tags:\n- '*.*.*':\n- - step:\n- script:\n- - bash ./gradlew assemble\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | bitbucket-pipelines.yml deleted online with Bitbucket |
652,304 | 30.01.2018 17:46:06 | -10,800 | f0ceee6b95fcad7e119d90277b27d5d972ce23c7 | fix. access level | [
{
"change_type": "MODIFY",
"old_path": "filestorage/src/main/java/ru/surfstudio/android/filestorage/BaseTextLocalCache.java",
"new_path": "filestorage/src/main/java/ru/surfstudio/android/filestorage/BaseTextLocalCache.java",
"diff": "@@ -14,7 +14,7 @@ public abstract class BaseTextLocalCache extends BaseLocalCache<String> {\n}\n@Override\n- ObjectConverter<String> getConverter() {\n+ public ObjectConverter<String> getConverter() {\nreturn new ObjectConverter<String>() {\n@Override\npublic byte[] encode(String value) {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix. access level |
652,303 | 13.03.2018 11:59:28 | -10,800 | de2e1d1225e2b18c9998940641968128ed9a77ae | #ANDDEP-97 made every instance of ItemController ViewType unique | [
{
"change_type": "MODIFY",
"old_path": "easyadapter/src/main/java/ru/surfstudio/android/easyadapter/controller/BaseItemController.java",
"new_path": "easyadapter/src/main/java/ru/surfstudio/android/easyadapter/controller/BaseItemController.java",
"diff": "@@ -19,6 +19,8 @@ package ru.surfstudio.android.easyadapter.controller;\nimport android.support.v7.widget.RecyclerView;\nimport android.view.ViewGroup;\n+import java.util.Random;\n+\nimport ru.surfstudio.android.easyadapter.EasyAdapter;\nimport ru.surfstudio.android.easyadapter.ItemList;\nimport ru.surfstudio.android.easyadapter.item.BaseItem;\n@@ -31,14 +33,20 @@ import ru.surfstudio.android.easyadapter.item.BaseItem;\n* @param <I> type of Item\n*/\npublic abstract class BaseItemController<H extends RecyclerView.ViewHolder, I extends BaseItem> {\n+\npublic static final long NO_ID = RecyclerView.NO_ID;\n+ private int uniqueControllerInstanceId;\n+\n+ public BaseItemController() {\n+ uniqueControllerInstanceId = new Random().nextInt();\n+ }\npublic abstract void bind(H holder, I item);\npublic abstract H createViewHolder(ViewGroup parent);\npublic int viewType() {\n- return getClass().getCanonicalName().hashCode();\n+ return getClass().getCanonicalName().hashCode() + uniqueControllerInstanceId;\n}\n/**\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | #ANDDEP-97 made every instance of ItemController ViewType unique |
652,323 | 11.04.2018 08:48:48 | 0 | 6e10590b8a55628dd7f7b4fafb691bc3535e0603 | deploy.gradle edited online with Bitbucket | [
{
"change_type": "MODIFY",
"old_path": "deploy.gradle",
"new_path": "deploy.gradle",
"diff": "@@ -9,7 +9,7 @@ uploadArchives {\npassword: System.getenv('surf_maven_password'))\n}\n- pom.groupId = 'ru.surfstudio.standard'\n+ pom.groupId = 'ru.surfstudio.android'\npom.artifactId = project.name\npom.version = moduleVersionName\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | deploy.gradle edited online with Bitbucket |
652,323 | 15.08.2018 10:45:04 | 0 | 13632b07399630d7bbe0f55bb15ad5b1db2f83f0 | add bitbucket notification for DeployJob | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -4,6 +4,7 @@ import ru.surfstudio.ci.stage.StageStrategy\nimport ru.surfstudio.ci.stage.body.CommonAndroidStages\nimport ru.surfstudio.ci.JarvisUtil\nimport ru.surfstudio.ci.CommonUtil\n+import ru.surfstudio.ci.RepositoryUtil\nimport ru.surfstudio.ci.NodeProvider\nimport ru.surfstudio.ci.Result\n@@ -29,6 +30,13 @@ pipeline.init()\n//configuration\npipeline.node = NodeProvider.getAndroidNode()\n+preExecuteStageBody = { stage ->\n+ if(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageStart(script, stage.name)\n+}\n+postExecuteStageBody = { stage ->\n+ if(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageFinish(script, stage.name, stage.result)\n+}\n+\npipeline.stages = [\npipeline.createStage(INIT, StageStrategy.FAIL_WHEN_STAGE_ERROR){\n@@ -63,6 +71,7 @@ pipeline.stages = [\ndoGenerateSubmoduleConfigurations: script.scm.doGenerateSubmoduleConfigurations,\nuserRemoteConfigs : script.scm.userRemoteConfigs,\n])\n+ RepositoryUtil.saveCurrentGitCommitHash(script)\n},\npipeline.createStage(BUILD, StageStrategy.FAIL_WHEN_STAGE_ERROR){\nCommonAndroidStages.buildStageBodyAndroid(script, \"clean assemble\")\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add bitbucket notification for DeployJob |
652,323 | 15.08.2018 10:48:54 | 0 | a8c73268e12dd41f46b93242977eb94406a1d797 | fix bitbucket notification for Deploy Job | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -30,10 +30,10 @@ pipeline.init()\n//configuration\npipeline.node = NodeProvider.getAndroidNode()\n-preExecuteStageBody = { stage ->\n+pipeline.preExecuteStageBody = { stage ->\nif(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageStart(script, stage.name)\n}\n-postExecuteStageBody = { stage ->\n+pipeline.postExecuteStageBody = { stage ->\nif(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageFinish(script, stage.name, stage.result)\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix bitbucket notification for Deploy Job |
652,323 | 14.09.2018 11:10:18 | 0 | 81690c8a0e689796759d1f17c5a5428de3495cbe | move artfactory to https | [
{
"change_type": "MODIFY",
"old_path": "gradle.properties",
"new_path": "gradle.properties",
"diff": "@@ -11,4 +11,4 @@ org.gradle.jvmargs=-Xmx2048m\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n-surf_maven_libs_url=http://artifactory.surfstudio.ru/artifactory/libs-release-local\n\\ No newline at end of file\n+surf_maven_libs_url=https://artifactory.surfstudio.ru/artifactory/libs-release-local\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | move artfactory to https |
652,323 | 14.09.2018 11:44:31 | 0 | 0fb4bfbff07807058528b419572b6747dcb2e215 | move deploy jenkinsfile to new version | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "-@Library('surf-lib') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\n+@Library('surf-lib@version-1.0.0-SNAPSHOT') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\nimport ru.surfstudio.ci.pipeline.EmptyPipeline\nimport ru.surfstudio.ci.stage.StageStrategy\n-import ru.surfstudio.ci.stage.body.CommonAndroidStages\n+import ru.surfstudio.ci.pipeline.helper.AndroidPipelineHelper\nimport ru.surfstudio.ci.JarvisUtil\nimport ru.surfstudio.ci.CommonUtil\nimport ru.surfstudio.ci.RepositoryUtil\n@@ -36,7 +36,7 @@ pipeline.postExecuteStageBody = { stage ->\nif(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageFinish(script, stage.name, stage.result)\n}\n-pipeline.initStageBody = {\n+pipeline.initializeBody = {\nCommonUtil.printInitialStageStrategies(pipeline)\nscript.echo \"artifactory user: ${script.env.surf_maven_username}\"\n@@ -97,7 +97,7 @@ pipeline.stages = [\n]\npipeline.finalizeBody = {\n- def jenkinsLink = CommonUtil.getBuildUrlHtmlLink(script)\n+ def jenkinsLink = CommonUtil.getBuildUrlMarkdownLink(script)\ndef message\ndef success = Result.SUCCESS.equals(pipeline.jobResult)\nif (!success) {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | move deploy jenkinsfile to new version |
652,323 | 07.10.2018 06:30:44 | 0 | bdb8ea69bdabf672c310b64b9548c99b1c0bd0dc | add empty JenkinsfileMirroring.groovy | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "+@Library('surf-lib@version-1.0.0-SNAPSHOT') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\n+import ru.surfstudio.ci.pipeline.PrPipelineAndroid\n+import ru.surfstudio.ci.pipeline.empty.EmptyScmPipeline\n+import ru.surfstudio.ci.stage.StageStrategy\n+\n+//init\n+def pipeline = new EmptyScmPipeline(this)\n+\n+//configuration\n+def mirrorRepoUrl = \"https://github.com/surfstudio/SurfAndroidStandard.git\"\n+def mirrorRepoCredentialID = \"76dbac13-e6ea-4ed0-a013-e06cad01be2d\"\n+\n+//stages\n+pipeline.stages = [\n+ pipeline.createStage(\"MIRRORING\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n+ //todo\n+ }\n+]\n+\n+//run\n+pipeline.run()\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add empty JenkinsfileMirroring.groovy |
652,323 | 07.10.2018 07:14:51 | 0 | c41f3cc1ad39bc38e9e5e4f2c68c67d97148234a | add mirroring logic | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@Library('surf-lib@version-1.0.0-SNAPSHOT') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\n-import ru.surfstudio.ci.pipeline.PrPipelineAndroid\nimport ru.surfstudio.ci.pipeline.empty.EmptyScmPipeline\nimport ru.surfstudio.ci.stage.StageStrategy\n@@ -7,13 +6,31 @@ import ru.surfstudio.ci.stage.StageStrategy\ndef pipeline = new EmptyScmPipeline(this)\n//configuration\n-def mirrorRepoUrl = \"https://github.com/surfstudio/SurfAndroidStandard.git\"\ndef mirrorRepoCredentialID = \"76dbac13-e6ea-4ed0-a013-e06cad01be2d\"\n+pipeline.propertiesProvider = {\n+ return [\n+ pipelineTriggers([\n+ GenericTrigger()\n+ ])\n+ ]\n+}\n+\n+\n//stages\npipeline.stages = [\n+ pipeline.createStage(\"CLONE\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n+ sh \"rm -rf android-standard\"\n+ withCredentials([usernamePassword(credentialsId: pipeline.repoCredentialsId, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n+ sh \"git clone --mirror https://$USERNAME:$PASSWORD@bitbucket.org/surfstudio/android-standard/\"\n+ }\n+ },\npipeline.createStage(\"MIRRORING\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n- //todo\n+ dir(\"android-standard\") {\n+ withCredentials([usernamePassword(credentialsId: mirrorRepoCredentialID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n+ sh \"git push --mirror https://$USERNAME:$PASSWORD@github.com/surfstudio/SurfAndroidStandard.git\"\n+ }\n+ }\n}\n]\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add mirroring logic |
652,323 | 07.10.2018 07:28:56 | 0 | 295d3617c9e3efd493ebb53a0134e4eb503c1bf5 | fix repo url for mirroring | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -24,7 +24,7 @@ pipeline.stages = [\npipeline.createStage(\"CLONE\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\nsh \"rm -rf android-standard\"\nwithCredentials([usernamePassword(credentialsId: pipeline.repoCredentialsId, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n- sh \"git clone --mirror https://$USERNAME:$PASSWORD@bitbucket.org/surfstudio/android-standard/\"\n+ sh \"git clone --mirror https://$USERNAME:$PASSWORD@bitbucket.org/surfstudio/android-standard.git\"\n}\n},\npipeline.createStage(\"MIRRORING\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix repo url for mirroring |
652,323 | 07.10.2018 07:40:26 | 0 | c2daa7ddd2070e71c5edcb849efa3dd4ce89315a | add mirroring credentials logging | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -24,12 +24,16 @@ pipeline.stages = [\npipeline.createStage(\"CLONE\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\nsh \"rm -rf android-standard\"\nwithCredentials([usernamePassword(credentialsId: pipeline.repoCredentialsId, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n+ sh \"credentialsId: $pipeline.repoCredentialsId\"\n+ sh \"username: $USERNAME\"\nsh \"git clone --mirror https://$USERNAME:$PASSWORD@bitbucket.org/surfstudio/android-standard.git\"\n}\n},\npipeline.createStage(\"MIRRORING\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard\") {\nwithCredentials([usernamePassword(credentialsId: mirrorRepoCredentialID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n+ sh \"credentialsId: $mirrorRepoCredentialID\"\n+ sh \"username: $USERNAME\"\nsh \"git push --mirror https://$USERNAME:$PASSWORD@github.com/surfstudio/SurfAndroidStandard.git\"\n}\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add mirroring credentials logging |
652,323 | 07.10.2018 07:43:35 | 0 | f17059c2bd3c1db6daacadebe9f6860f0b94911f | fix mirroring logs | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -24,16 +24,16 @@ pipeline.stages = [\npipeline.createStage(\"CLONE\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\nsh \"rm -rf android-standard\"\nwithCredentials([usernamePassword(credentialsId: pipeline.repoCredentialsId, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n- sh \"credentialsId: $pipeline.repoCredentialsId\"\n- sh \"username: $USERNAME\"\n+ echo \"credentialsId: $pipeline.repoCredentialsId\"\n+ echo \"username: $USERNAME\"\nsh \"git clone --mirror https://$USERNAME:$PASSWORD@bitbucket.org/surfstudio/android-standard.git\"\n}\n},\npipeline.createStage(\"MIRRORING\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard\") {\nwithCredentials([usernamePassword(credentialsId: mirrorRepoCredentialID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n- sh \"credentialsId: $mirrorRepoCredentialID\"\n- sh \"username: $USERNAME\"\n+ echo \"credentialsId: $mirrorRepoCredentialID\"\n+ echo \"username: $USERNAME\"\nsh \"git push --mirror https://$USERNAME:$PASSWORD@github.com/surfstudio/SurfAndroidStandard.git\"\n}\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix mirroring logs |
652,323 | 08.10.2018 14:07:41 | 0 | 9de7712af9e488353694d99f5330ba0da2285454 | fix typo inJenkinsfileMirroring.groovy | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -37,7 +37,7 @@ pipeline.stages = [\nsh \"git clone --mirror https://${encodeUrl(USERNAME)}:${encodeUrl(PASSWORD)}@bitbucket.org/surfstudio/android-standard.git\"\n}\n},\n- pipeline.createStage(\"Mirroing\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n+ pipeline.createStage(\"Mirroring\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard.git\") {\nwithCredentials([usernamePassword(credentialsId: mirrorRepoCredentialID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\necho \"credentialsId: $mirrorRepoCredentialID\"\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix typo inJenkinsfileMirroring.groovy |
652,323 | 16.10.2018 09:09:04 | -10,800 | 3161b7392067422ba0eb9b57e27cc199240c270d | add refs logs for mirroring | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "-@Library('surf-lib@version-1.0.0-SNAPSHOT') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\n-import ru.surfstudio.ci.pipeline.empty.EmptyScmPipeline\n-import ru.surfstudio.ci.stage.StageStrategy\n-import ru.surfstudio.ci.NodeProvider\nimport ru.surfstudio.ci.CommonUtil\nimport ru.surfstudio.ci.JarvisUtil\n+import ru.surfstudio.ci.NodeProvider\nimport ru.surfstudio.ci.Result\n-import java.net.URLEncoder\n+@Library('surf-lib@version-1.0.0-SNAPSHOT')\n+import ru.surfstudio.ci.pipeline.empty.EmptyScmPipeline\n+@Library('surf-lib@version-1.0.0-SNAPSHOT') // https://bitbucket.org/surfstudio/jenkins-pipeline-lib/\n+import ru.surfstudio.ci.pipeline.empty.EmptyScmPipeline\n+import ru.surfstudio.ci.stage.StageStrategy\ndef encodeUrl(string){\nURLEncoder.encode(string, \"UTF-8\")\n@@ -37,6 +38,22 @@ pipeline.stages = [\nsh \"git clone --mirror https://${encodeUrl(USERNAME)}:${encodeUrl(PASSWORD)}@bitbucket.org/surfstudio/android-standard.git\"\n}\n},\n+ pipeline.createStage(\"Sanitize\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n+ dir(\"android-standard.git\") {\n+ sh \"ls\"\n+ dir(\".git\") {\n+ sh \"ls\"\n+ dir(\"refs\") {\n+ sh \"ls\"\n+ dir(\"origin\") {\n+ sh \"ls\"\n+ }\n+ }\n+ }\n+\n+ }\n+ //\"rm -rf android-standard.git\"\n+ },\npipeline.createStage(\"Mirroring\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard.git\") {\nwithCredentials([usernamePassword(credentialsId: mirrorRepoCredentialID, usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add refs logs for mirroring |
652,323 | 16.10.2018 09:14:04 | -10,800 | 3e0ed622d8d74a6972854c1d5fcfead151ec5934 | fix refs logs for mirroring | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -40,8 +40,6 @@ pipeline.stages = [\n},\npipeline.createStage(\"Sanitize\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard.git\") {\n- sh \"ls\"\n- dir(\".git\") {\nsh \"ls\"\ndir(\"refs\") {\nsh \"ls\"\n@@ -50,8 +48,6 @@ pipeline.stages = [\n}\n}\n}\n-\n- }\n//\"rm -rf android-standard.git\"\n},\npipeline.createStage(\"Mirroring\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix refs logs for mirroring |
652,323 | 16.10.2018 09:34:48 | -10,800 | f8a816c63fcd9b63552c3beaa1b3b20fe4c8ff93 | remove project-snapshot refs when mirroring | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileMirroring.groovy",
"new_path": "ci-internal/JenkinsfileMirroring.groovy",
"diff": "@@ -40,15 +40,17 @@ pipeline.stages = [\n},\npipeline.createStage(\"Sanitize\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard.git\") {\n- sh \"ls\"\n- dir(\"refs\") {\n- sh \"ls\"\n- dir(\"origin\") {\n- sh \"ls\"\n+ def packedRefsFile = \"packed-refs\"\n+ def packedRefs = script.readFile file: packedRefsFile\n+ script.echo \"packed_refs: $packedRefs\"\n+ def sanitizedPackedRefs = \"\"\n+ for(ref in packedRefs.split(\"\\n\")) {\n+ if(!ref.contains(\"project-snapshot\")) {\n+ sanitizedPackedRefs += ref\n}\n}\n+ script.writeFile file: packedRefsFile, text: sanitizedPackedRefs\n}\n- //\"rm -rf android-standard.git\"\n},\npipeline.createStage(\"Mirroring\", StageStrategy.FAIL_WHEN_STAGE_ERROR) {\ndir(\"android-standard.git\") {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | remove project-snapshot refs when mirroring |
652,340 | 25.10.2018 11:23:03 | -10,800 | 2ec8e2fbeddb468a8a3af039069fc39fbb784a94 | init 0.4.0-SNAPSHOT, remove deprecated | [
{
"change_type": "MODIFY",
"old_path": "template/app-injector/src/main/java/ru/surfstudio/standard/app_injector/AppComponent.kt",
"new_path": "template/app-injector/src/main/java/ru/surfstudio/standard/app_injector/AppComponent.kt",
"diff": "@@ -8,6 +8,7 @@ import ru.surfstudio.android.core.app.ActiveActivityHolder\nimport ru.surfstudio.android.core.app.StringsProvider\nimport ru.surfstudio.android.core.ui.navigation.activity.navigator.GlobalNavigator\nimport ru.surfstudio.android.dagger.scope.PerApplication\n+import ru.surfstudio.android.notification.PushHandler\nimport ru.surfstudio.android.notification.interactor.push.storage.FcmStorage\nimport ru.surfstudio.android.rx.extension.scheduler.SchedulersProvider\nimport ru.surfstudio.android.shared.pref.NO_BACKUP_SHARED_PREF\n@@ -20,6 +21,7 @@ import ru.surfstudio.standard.app_injector.network.OkHttpModule\nimport ru.surfstudio.standard.app_injector.network.cache.CacheModule\nimport ru.surfstudio.standard.app_injector.ui.notification.FcmModule\nimport ru.surfstudio.standard.app_injector.ui.notification.MessagingService\n+import ru.surfstudio.standard.app_injector.ui.notification.NotificationModule\nimport ru.surfstudio.standard.i_initialization.InitializeAppInteractor\nimport ru.surfstudio.standard.i_session.SessionChangedInteractor\nimport javax.inject.Named\n@@ -35,7 +37,8 @@ import javax.inject.Named\nNetworkModule::class,\nOkHttpModule::class,\nCacheModule::class,\n- FcmModule::class])\n+ FcmModule::class,\n+ NotificationModule::class])\ninterface AppComponent {\nfun initializeAppInteractor(): InitializeAppInteractor\nfun context(): Context\n@@ -46,6 +49,7 @@ interface AppComponent {\nfun stringsProvider(): StringsProvider\nfun globalNavigator(): GlobalNavigator\nfun fcmStorage(): FcmStorage\n+ fun pushHandler(): PushHandler\nfun inject(to: MessagingService)\n@Named(NO_BACKUP_SHARED_PREF) fun sharedPreferences(): SharedPreferences\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/main/java/ru/surfstudio/standard/app_injector/ui/notification/FirebaseServiceComponent.kt",
"diff": "+package ru.surfstudio.standard.app_injector.ui.notification\n+\n+\n+import dagger.Component\n+import ru.surfstudio.android.notification.interactor.push.storage.FcmStorage\n+import ru.surfstudio.standard.app_injector.AppComponent\n+import javax.inject.Scope\n+\n+@PerService\n+@Component(dependencies = [AppComponent::class])\n+interface FirebaseServiceComponent {\n+\n+ fun fcmStorage(): FcmStorage\n+\n+ fun inject(s: MessagingService)\n+}\n+\n+@Scope\n+@Retention(AnnotationRetention.RUNTIME)\n+annotation class PerService\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/main/java/ru/surfstudio/standard/app_injector/ui/notification/NotificationModule.kt",
"diff": "+package ru.surfstudio.standard.app_injector.ui.notification\n+\n+import dagger.Module\n+import dagger.Provides\n+import ru.surfstudio.android.core.app.ActiveActivityHolder\n+import ru.surfstudio.android.dagger.scope.PerApplication\n+import ru.surfstudio.android.notification.PushHandler\n+import ru.surfstudio.android.notification.impl.DefaultPushHandler\n+import ru.surfstudio.android.notification.interactor.push.PushInteractor\n+import ru.surfstudio.android.notification.ui.notification.AbstractPushHandleStrategyFactory\n+\n+@Module\n+class NotificationModule {\n+\n+ @Provides\n+ @PerApplication\n+ fun providePushInteractor() = PushInteractor()\n+\n+ @Provides\n+ @PerApplication\n+ fun providePushHandleStrategyFactory(): AbstractPushHandleStrategyFactory =\n+ PushHandleStrategyFactory\n+\n+ @Provides\n+ @PerApplication\n+ fun providePushHandler(\n+ activeActivityHolder: ActiveActivityHolder,\n+ pushHandleStrategyFactory: AbstractPushHandleStrategyFactory,\n+ pushInteractor: PushInteractor\n+ ): PushHandler =\n+ DefaultPushHandler(\n+ activeActivityHolder,\n+ pushHandleStrategyFactory,\n+ pushInteractor\n+ )\n+\n+}\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | init 0.4.0-SNAPSHOT, remove deprecated |
652,323 | 25.10.2018 12:27:38 | -10,800 | 529c1e387aef0216d9878278824b6fd13d289a80 | fix deploy pipeline import | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -9,6 +9,8 @@ import ru.surfstudio.ci.NodeProvider\nimport ru.surfstudio.ci.AndroidUtil\nimport ru.surfstudio.ci.Result\nimport ru.surfstudio.ci.AbortDuplicateStrategy\n+import java.util.regex.Pattern\n+import java.util.regex.Matcher\nimport static ru.surfstudio.ci.CommonUtil.applyParameterIfNotEmpty\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix deploy pipeline import |
652,323 | 21.11.2018 22:03:20 | -10,800 | 4f4b53006162ff2f42f2d63c953042c8d3016382 | ci check version up commit message | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -91,8 +91,13 @@ pipeline.stages = [\nRepositoryUtil.saveCurrentGitCommitHash(script)\n},\npipeline.createStage(CHECK_BRANCH_AND_VERSION, StageStrategy.FAIL_WHEN_STAGE_ERROR){\n- if (RepositoryUtil.isCurrentCommitMessageContainsSkipCi(script) && !CommonUtil.isJobStartedByUser(script)){\n- throw new InterruptedException(\"Job aborted, because it triggered automatically and last commit contains [skip ci] label\")\n+ if (RepositoryUtil.isCurrentCommitMessageContainsSkipCiLabel(script) && !CommonUtil.isJobStartedByUser(script)){\n+ throw new InterruptedException(\"Job aborted, because it triggered automatically and last commit message contains $RepositoryUtil.SKIP_CI_LABEL1 label\")\n+ }\n+ if (RepositoryUtil.isCurrentCommitMessageContainsVersionLabel(script)){\n+ script.echo \"Disable automatic version increment because commit message contains $RepositoryUtil.VERSION_LABEL1\"\n+ pipeline.getStage(VERSION_INCREMENT).strategy = StageStrategy.SKIP_STAGE\n+ pipeline.getStage(VERSION_PUSH).strategy = StageStrategy.SKIP_STAGE\n}\ndef rawVersion = AndroidUtil.getGradleVariable(script, gradleConfigFile, androidStandardVersionVarName)\ndef version = CommonUtil.removeQuotesFromTheEnds(rawVersion) //remove quotes\n@@ -136,25 +141,21 @@ pipeline.stages = [\nAndroidPipelineHelper.staticCodeAnalysisStageBody(script)\n},\npipeline.createStage(VERSION_INCREMENT, StageStrategy.SKIP_STAGE) {\n- if(isProjectSnapshotBranch(branchName)){\ndef rawVersion = AndroidUtil.getGradleVariable(script, gradleConfigFile, androidStandardVersionVarName)\nString[] versionParts = rawVersion.split(\"-\")\nString newSnapshotVersion = String.valueOf(Integer.parseInt(versionParts[2]) + 1)\nnewRawVersion = versionParts[0] + \"-\" + versionParts[1] + \"-\" + newSnapshotVersion + \"-\" + versionParts[3]\nAndroidUtil.changeGradleVariable(script, gradleConfigFile, androidStandardVersionVarName, newRawVersion)\n- }\n},\npipeline.createStage(DEPLOY, StageStrategy.FAIL_WHEN_STAGE_ERROR) {\nscript.sh \"./gradlew clean uploadArchives\"\n},\npipeline.createStage(VERSION_PUSH, StageStrategy.SKIP_STAGE) {\n- if(isProjectSnapshotBranch(branchName)) {\ndef version = CommonUtil.removeQuotesFromTheEnds(\nAndroidUtil.getGradleVariable(script, gradleConfigFile, androidStandardVersionVarName))\n- script.sh \"git commit -a -m \\\"[skip ci] Increase version to $version\\\"\"\n+ script.sh \"git commit -a -m \\\"Increase version to $version\\\" $RepositoryUtil.SKIP_CI_LABEL1 $RepositoryUtil.VERSION_LABEL1\"\nscript.sh \"git push\"\n}\n- }\n]\npipeline.finalizeBody = {\n@@ -189,7 +190,7 @@ def boolean checkVersionAndBranch(Object script, String branch, String branchReg\nif (versionMatcher.matches()) {\nreturn true\n} else {\n- script.error(\"Deploy version: '$version' from branch: '$branch' forbidden, it must corresponds to $versionRegex\")\n+ script.error(\"Deploy version: '$version' from branch: '$branch' forbidden, it must corresponds to regexp: '$versionRegex'\")\n}\n}\nreturn false\n@@ -207,7 +208,7 @@ def boolean checkVersionAndBranchForProjectSnapshot(Object script, String branch\nif (versionMatcher.matches()) {\nreturn true\n} else {\n- script.error(\"Deploy version: '$version' from branch: '$branch' forbidden, it must corresponds to $versionRegex\")\n+ script.error(\"Deploy version: '$version' from branch: '$branch' forbidden, it must corresponds to regexp: '$versionRegex'\")\n}\n}\nreturn false\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ci check version up commit message |
652,323 | 22.11.2018 16:59:35 | -10,800 | d31b895962c6a6626311a203c6f90a3174d99063 | fix manual start deploy job | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -59,6 +59,10 @@ pipeline.initializeBody = {\nvalue -> branchName = value\n}\n+ if(branchName.contains(\"origin/\")){\n+ branchName = branchName.replace(\"origin/\", \"\")\n+ }\n+\nif(isProjectSnapshotBranch(branchName)){\nscript.echo \"Apply lightweight strategies and automatic version increment for project-snapshot branch\"\npipeline.getStage(BUILD).strategy = StageStrategy.SKIP_STAGE\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | fix manual start deploy job |
652,323 | 28.11.2018 08:59:26 | 0 | a8d8244447a0ee37a698c7aeebde0a3abf7cce56 | remove skipped jobs | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -31,11 +31,15 @@ def VERSION_PUSH = 'Version Push'\ndef gradleConfigFile = \"config.gradle\"\ndef androidStandardVersionVarName = \"moduleVersionName\"\n+//vars\n+def branchName = \"\"\n+def actualAndroidStandardVersion = \"<unknown>\"\n+def removeSkippedBuilds = true\n+\n//init\ndef script = this\ndef pipeline = new EmptyScmPipeline(script)\n-def branchName = \"\"\n-def actualAndroidStandardVersion = \"<unknown>\"\n+\npipeline.init()\n//configuration\n@@ -94,6 +98,9 @@ pipeline.stages = [\nscript.echo \"Checking $RepositoryUtil.SKIP_CI_LABEL1 label in last commit message for automatic builds\"\nif (RepositoryUtil.isCurrentCommitMessageContainsSkipCiLabel(script) && !CommonUtil.isJobStartedByUser(script)) {\n+ if(removeSkippedBuilds) {\n+ script.currentBuild.rawBuild.delete()\n+ }\nthrow new InterruptedException(\"Job aborted, because it triggered automatically and last commit message contains $RepositoryUtil.SKIP_CI_LABEL1 label\")\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | remove skipped jobs |
652,323 | 24.12.2018 09:52:21 | 0 | fc44cd257755e4a1c7a78fc18b255262e886f63b | add androidTest Build Type configuration param for Pr pipeline | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"new_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"diff": "@@ -10,6 +10,7 @@ pipeline.init()\npipeline.getStage(pipeline.INSTRUMENTATION_TEST).strategy = StageStrategy.SKIP_STAGE\npipeline.getStage(pipeline.STATIC_CODE_ANALYSIS).strategy = StageStrategy.SKIP_STAGE\npipeline.buildGradleTask = \"clean assemble\"\n+pipeline.androidTestBuildType = \"debug\"\n//run\npipeline.run()\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add androidTest Build Type configuration param for Pr pipeline |
652,323 | 29.12.2018 13:27:16 | -10,800 | 133befcb6a5a9d3f96dda5cba421ae67c43e3b07 | add test scalpel layout | [
{
"change_type": "MODIFY",
"old_path": "animations-sample/build.gradle",
"new_path": "animations-sample/build.gradle",
"diff": "@@ -9,4 +9,5 @@ android {\ndependencies {\nimplementation project(':animations')\nimplementation project(':sample-common')\n+ implementation 'com.jakewharton.scalpel:scalpel:1.1.2'\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"diff": "package ru.surfstudio.android.animations.sample\nimport android.os.Bundle\n+import android.os.Handler\n+import android.util.Log\nimport android.view.Gravity\n+import android.view.ViewGroup\n+import android.widget.FrameLayout\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.coordinatorlayout.widget.CoordinatorLayout\nimport com.google.android.material.snackbar.Snackbar\n+import com.jakewharton.scalpel.ScalpelFrameLayout\nimport kotlinx.android.synthetic.main.activity_main.*\nimport ru.surfstudio.android.animations.anim.*\nimport ru.surfstudio.android.animations.behaviors.BottomButtonBehavior\n@@ -15,6 +20,23 @@ class MainActivity : AppCompatActivity() {\nsuper.onCreate(savedInstanceState)\nsetContentView(R.layout.activity_main)\n+ Handler().postDelayed({\n+ val scalpel = ScalpelFrameLayout(this)\n+ val content = this.findViewById<ViewGroup>(android.R.id.content)\n+ val childViews = (0..content.childCount - 1)\n+ .map { content.getChildAt(it) }\n+ .toList()\n+ Log.d(\"AAA\", childViews.toString())\n+ content.removeAllViews()\n+ content.addView(scalpel,\n+ FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,\n+ FrameLayout.LayoutParams.MATCH_PARENT))\n+ childViews.forEach { scalpel.addView(it) }\n+ scalpel.isLayerInteractionEnabled = true\n+ }, 1000)\n+\n+\n+\nval params = bottom_btn.layoutParams as CoordinatorLayout.LayoutParams\nparams.behavior = BottomButtonBehavior()\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelFrameLayout.java",
"diff": "+package ru.surfstudio.android.animations.sample;\n+\n+import android.content.Context;\n+import android.content.res.Resources;\n+import android.content.res.Resources.NotFoundException;\n+import android.graphics.Camera;\n+import android.graphics.Canvas;\n+import android.graphics.Matrix;\n+import android.graphics.Paint;\n+import android.graphics.Rect;\n+import android.graphics.Typeface;\n+import android.os.Build;\n+import android.util.AttributeSet;\n+import android.util.Log;\n+import android.util.SparseArray;\n+import android.view.MotionEvent;\n+import android.view.View;\n+import android.view.ViewConfiguration;\n+import android.view.ViewGroup;\n+import android.widget.FrameLayout;\n+\n+import java.util.ArrayDeque;\n+import java.util.BitSet;\n+import java.util.Deque;\n+\n+import static android.graphics.Paint.ANTI_ALIAS_FLAG;\n+import static android.graphics.Paint.Style.STROKE;\n+import static android.graphics.Typeface.NORMAL;\n+import static android.os.Build.VERSION_CODES.JELLY_BEAN;\n+import static android.view.MotionEvent.ACTION_DOWN;\n+import static android.view.MotionEvent.ACTION_POINTER_UP;\n+import static android.view.MotionEvent.INVALID_POINTER_ID;\n+\n+/**\n+ * Renders your view hierarchy as an interactive 3D visualization of layers.\n+ * <p>\n+ * Interactions supported:\n+ * <ul>\n+ * <li>Single touch: controls the rotation of the model.</li>\n+ * <li>Two finger vertical pinch: Adjust zoom.</li>\n+ * <li>Two finger horizontal pinch: Adjust layer spacing.</li>\n+ * </ul>\n+ */\n+public class ScalpelFrameLayout extends FrameLayout {\n+ private static final int TRACKING_UNKNOWN = 0;\n+ private static final int TRACKING_VERTICALLY = 1;\n+ private static final int TRACKING_HORIZONTALLY = -1;\n+ private static final int ROTATION_MAX = 60;\n+ private static final int ROTATION_MIN = -ROTATION_MAX;\n+ private static final int ROTATION_DEFAULT_X = -10;\n+ private static final int ROTATION_DEFAULT_Y = 15;\n+ private static final float ZOOM_DEFAULT = 0.6f;\n+ private static final float ZOOM_MIN = 0.33f;\n+ private static final float ZOOM_MAX = 2f;\n+ private static final int SPACING_DEFAULT = 25;\n+ private static final int SPACING_MIN = 10;\n+ private static final int SPACING_MAX = 100;\n+ private static final int CHROME_COLOR = 0xFF888888;\n+ private static final int CHROME_SHADOW_COLOR = 0xFF000000;\n+ private static final int TEXT_OFFSET_DP = 2;\n+ private static final int TEXT_SIZE_DP = 10;\n+ private static final int CHILD_COUNT_ESTIMATION = 25;\n+ private static final boolean DEBUG = false;\n+\n+ private static void log(String message, Object... args) {\n+ Log.d(\"Scalpel\", String.format(message, args));\n+ }\n+\n+ private static class LayeredView {\n+ View view;\n+ int layer;\n+\n+ void set(View view, int layer) {\n+ this.view = view;\n+ this.layer = layer;\n+ }\n+\n+ void clear() {\n+ view = null;\n+ layer = -1;\n+ }\n+ }\n+\n+ private final Rect viewBoundsRect = new Rect();\n+ private final Paint viewBorderPaint = new Paint(ANTI_ALIAS_FLAG);\n+ private final Camera camera = new Camera();\n+ private final Matrix matrix = new Matrix();\n+ private final int[] location = new int[2];\n+ private final BitSet visibilities = new BitSet(CHILD_COUNT_ESTIMATION);\n+ private final SparseArray<String> idNames = new SparseArray<>();\n+ private final Deque<LayeredView> layeredViewQueue = new ArrayDeque<>();\n+ private final Pool<LayeredView> layeredViewPool = new Pool<LayeredView>(CHILD_COUNT_ESTIMATION) {\n+ @Override\n+ protected LayeredView newObject() {\n+ return new LayeredView();\n+ }\n+ };\n+\n+ private final Resources res;\n+ private final float density;\n+ private final float slop;\n+ private final float textOffset;\n+ private final float textSize;\n+\n+ private boolean enabled;\n+ private boolean drawViews = true;\n+ private boolean drawIds;\n+\n+ private int pointerOne = INVALID_POINTER_ID;\n+ private float lastOneX;\n+ private float lastOneY;\n+ private int pointerTwo = INVALID_POINTER_ID;\n+ private float lastTwoX;\n+ private float lastTwoY;\n+ private int multiTouchTracking = TRACKING_UNKNOWN;\n+\n+ private float rotationY = ROTATION_DEFAULT_Y;\n+ private float rotationX = ROTATION_DEFAULT_X;\n+ private float zoom = ZOOM_DEFAULT;\n+ private float spacing = SPACING_DEFAULT;\n+\n+ private int chromeColor;\n+ private int chromeShadowColor;\n+\n+ public ScalpelFrameLayout(Context context) {\n+ this(context, null);\n+ }\n+\n+ public ScalpelFrameLayout(Context context, AttributeSet attrs) {\n+ this(context, attrs, 0);\n+ }\n+\n+ public ScalpelFrameLayout(Context context, AttributeSet attrs, int defStyle) {\n+ super(context, attrs, defStyle);\n+ res = context.getResources();\n+ density = context.getResources().getDisplayMetrics().density;\n+ slop = ViewConfiguration.get(context).getScaledTouchSlop();\n+\n+ textSize = TEXT_SIZE_DP * density;\n+ textOffset = TEXT_OFFSET_DP * density;\n+\n+ setChromeColor(CHROME_COLOR);\n+ viewBorderPaint.setStyle(STROKE);\n+ viewBorderPaint.setTextSize(textSize);\n+ setChromeShadowColor(CHROME_SHADOW_COLOR);\n+ if (Build.VERSION.SDK_INT >= JELLY_BEAN) {\n+ viewBorderPaint.setTypeface(Typeface.create(\"sans-serif-condensed\", NORMAL));\n+ }\n+ }\n+\n+ /**\n+ * Set the view border chrome color.\n+ */\n+ public void setChromeColor(int color) {\n+ if (chromeColor != color) {\n+ viewBorderPaint.setColor(color);\n+ chromeColor = color;\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Get the view border chrome color.\n+ */\n+ public int getChromeColor() {\n+ return chromeColor;\n+ }\n+\n+ /**\n+ * Set the view border chrome shadow color.\n+ */\n+ public void setChromeShadowColor(int color) {\n+ if (chromeShadowColor != color) {\n+ viewBorderPaint.setShadowLayer(1, -1, 1, color);\n+ chromeShadowColor = color;\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Get the view border chrome shadow color.\n+ */\n+ public int getChromeShadowColor() {\n+ return chromeShadowColor;\n+ }\n+\n+ /**\n+ * Set whether or not the 3D view layer interaction is enabled.\n+ */\n+ public void setLayerInteractionEnabled(boolean enabled) {\n+ if (this.enabled != enabled) {\n+ this.enabled = enabled;\n+ setWillNotDraw(!enabled);\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Returns true when 3D view layer interaction is enabled.\n+ */\n+ public boolean isLayerInteractionEnabled() {\n+ return enabled;\n+ }\n+\n+ /**\n+ * Set whether the view layers draw their contents. When false, only wireframes are shown.\n+ */\n+ public void setDrawViews(boolean drawViews) {\n+ if (this.drawViews != drawViews) {\n+ this.drawViews = drawViews;\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Returns true when view layers draw their contents.\n+ */\n+ public boolean isDrawingViews() {\n+ return drawViews;\n+ }\n+\n+ /**\n+ * Set whether the view layers draw their IDs.\n+ */\n+ public void setDrawIds(boolean drawIds) {\n+ if (this.drawIds != drawIds) {\n+ this.drawIds = drawIds;\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Returns true when view layers draw their IDs.\n+ */\n+ public boolean isDrawingIds() {\n+ return drawIds;\n+ }\n+\n+ @Override\n+ public boolean onInterceptTouchEvent(MotionEvent ev) {\n+ return enabled || super.onInterceptTouchEvent(ev);\n+ }\n+\n+ @Override\n+ public boolean onTouchEvent(@SuppressWarnings(\"NullableProblems\") MotionEvent event) {\n+ if (!enabled) {\n+ return super.onTouchEvent(event);\n+ }\n+\n+ int action = event.getActionMasked();\n+ switch (action) {\n+ case MotionEvent.ACTION_DOWN:\n+ case MotionEvent.ACTION_POINTER_DOWN: {\n+ int index = (action == ACTION_DOWN) ? 0 : event.getActionIndex();\n+ if (pointerOne == INVALID_POINTER_ID) {\n+ pointerOne = event.getPointerId(index);\n+ lastOneX = event.getX(index);\n+ lastOneY = event.getY(index);\n+ if (DEBUG)\n+ log(\"Got pointer 1! id: %s x: %s y: %s\", pointerOne, lastOneY, lastOneY);\n+ } else if (pointerTwo == INVALID_POINTER_ID) {\n+ pointerTwo = event.getPointerId(index);\n+ lastTwoX = event.getX(index);\n+ lastTwoY = event.getY(index);\n+ if (DEBUG)\n+ log(\"Got pointer 2! id: %s x: %s y: %s\", pointerTwo, lastTwoY, lastTwoY);\n+ } else {\n+ if (DEBUG)\n+ log(\"Ignoring additional pointer. id: %s\", event.getPointerId(index));\n+ }\n+ break;\n+ }\n+\n+ case MotionEvent.ACTION_MOVE: {\n+ if (pointerTwo == INVALID_POINTER_ID) {\n+ // Single pointer controlling 3D rotation.\n+ for (int i = 0, count = event.getPointerCount(); i < count; i++) {\n+ if (pointerOne == event.getPointerId(i)) {\n+ float eventX = event.getX(i);\n+ float eventY = event.getY(i);\n+ float dx = eventX - lastOneX;\n+ float dy = eventY - lastOneY;\n+ float drx = 90 * (dx / getWidth());\n+ float dry = 90 * (-dy / getHeight()); // Invert Y-axis.\n+ // An 'x' delta affects 'y' rotation and vise versa.\n+ rotationY = Math.min(Math.max(rotationY + drx, ROTATION_MIN), ROTATION_MAX);\n+ rotationX = Math.min(Math.max(rotationX + dry, ROTATION_MIN), ROTATION_MAX);\n+ if (DEBUG) {\n+ log(\"Single pointer moved (%s, %s) affecting rotation (%s, %s).\", dx, dy, drx, dry);\n+ }\n+\n+ lastOneX = eventX;\n+ lastOneY = eventY;\n+\n+ invalidate();\n+ }\n+ }\n+ } else {\n+ // We know there's two pointers and we only care about pointerOne and pointerTwo\n+ int pointerOneIndex = event.findPointerIndex(pointerOne);\n+ int pointerTwoIndex = event.findPointerIndex(pointerTwo);\n+\n+ float xOne = event.getX(pointerOneIndex);\n+ float yOne = event.getY(pointerOneIndex);\n+ float xTwo = event.getX(pointerTwoIndex);\n+ float yTwo = event.getY(pointerTwoIndex);\n+\n+ float dxOne = xOne - lastOneX;\n+ float dyOne = yOne - lastOneY;\n+ float dxTwo = xTwo - lastTwoX;\n+ float dyTwo = yTwo - lastTwoY;\n+\n+ if (multiTouchTracking == TRACKING_UNKNOWN) {\n+ float adx = Math.abs(dxOne) + Math.abs(dxTwo);\n+ float ady = Math.abs(dyOne) + Math.abs(dyTwo);\n+\n+ if (adx > slop * 2 || ady > slop * 2) {\n+ if (adx > ady) {\n+ // Left/right movement wins. Track horizontal.\n+ multiTouchTracking = TRACKING_HORIZONTALLY;\n+ } else {\n+ // Up/down movement wins. Track vertical.\n+ multiTouchTracking = TRACKING_VERTICALLY;\n+ }\n+ }\n+ }\n+\n+ if (multiTouchTracking == TRACKING_VERTICALLY) {\n+ if (yOne >= yTwo) {\n+ zoom += dyOne / getHeight() - dyTwo / getHeight();\n+ } else {\n+ zoom += dyTwo / getHeight() - dyOne / getHeight();\n+ }\n+\n+ zoom = Math.min(Math.max(zoom, ZOOM_MIN), ZOOM_MAX);\n+ invalidate();\n+ } else if (multiTouchTracking == TRACKING_HORIZONTALLY) {\n+ if (xOne >= xTwo) {\n+ spacing += (dxOne / getWidth() * SPACING_MAX) - (dxTwo / getWidth() * SPACING_MAX);\n+ } else {\n+ spacing += (dxTwo / getWidth() * SPACING_MAX) - (dxOne / getWidth() * SPACING_MAX);\n+ }\n+\n+ spacing = Math.min(Math.max(spacing, SPACING_MIN), SPACING_MAX);\n+ invalidate();\n+ }\n+\n+ if (multiTouchTracking != TRACKING_UNKNOWN) {\n+ lastOneX = xOne;\n+ lastOneY = yOne;\n+ lastTwoX = xTwo;\n+ lastTwoY = yTwo;\n+ }\n+ }\n+ break;\n+ }\n+\n+ case MotionEvent.ACTION_CANCEL:\n+ case MotionEvent.ACTION_UP:\n+ case MotionEvent.ACTION_POINTER_UP: {\n+ int index = (action != ACTION_POINTER_UP) ? 0 : event.getActionIndex();\n+ int pointerId = event.getPointerId(index);\n+ if (pointerOne == pointerId) {\n+ // Shift pointer two (real or invalid) up to pointer one.\n+ pointerOne = pointerTwo;\n+ lastOneX = lastTwoX;\n+ lastOneY = lastTwoY;\n+ if (DEBUG) log(\"Promoting pointer 2 (%s) to pointer 1.\", pointerTwo);\n+ // Clear pointer two and tracking.\n+ pointerTwo = INVALID_POINTER_ID;\n+ multiTouchTracking = TRACKING_UNKNOWN;\n+ } else if (pointerTwo == pointerId) {\n+ if (DEBUG) log(\"Lost pointer 2 (%s).\", pointerTwo);\n+ pointerTwo = INVALID_POINTER_ID;\n+ multiTouchTracking = TRACKING_UNKNOWN;\n+ }\n+ break;\n+ }\n+ }\n+\n+ return true;\n+ }\n+\n+ @Override\n+ public void draw(@SuppressWarnings(\"NullableProblems\") Canvas canvas) {\n+ if (!enabled) {\n+ super.draw(canvas);\n+ return;\n+ }\n+\n+ getLocationInWindow(location);\n+ float x = location[0];\n+ float y = location[1];\n+\n+ int saveCount = canvas.save();\n+\n+ float cx = getWidth() / 2f;\n+ float cy = getHeight() / 2f;\n+\n+ camera.save();\n+ camera.rotate(rotationX, rotationY, 0);\n+ camera.getMatrix(matrix);\n+ camera.restore();\n+\n+ matrix.preTranslate(-cx, -cy);\n+ matrix.postTranslate(cx, cy);\n+ canvas.concat(matrix);\n+ canvas.scale(zoom, zoom, cx, cy);\n+\n+ if (!layeredViewQueue.isEmpty()) {\n+ throw new AssertionError(\"View queue is not empty.\");\n+ }\n+\n+ // We don't want to be rendered so seed the queue with our children.\n+ for (int i = 0, count = getChildCount(); i < count; i++) {\n+ LayeredView layeredView = layeredViewPool.obtain();\n+ layeredView.set(getChildAt(i), 0);\n+ layeredViewQueue.add(layeredView);\n+ }\n+\n+ while (!layeredViewQueue.isEmpty()) {\n+ LayeredView layeredView = layeredViewQueue.removeFirst();\n+ View view = layeredView.view;\n+ int layer = layeredView.layer;\n+\n+ // Restore the object to the pool for use later.\n+ layeredView.clear();\n+ layeredViewPool.restore(layeredView);\n+\n+ // Hide any visible children.\n+ if (view instanceof ViewGroup) {\n+ ViewGroup viewGroup = (ViewGroup) view;\n+ visibilities.clear();\n+ for (int i = 0, count = viewGroup.getChildCount(); i < count; i++) {\n+ View child = viewGroup.getChildAt(i);\n+ //noinspection ConstantConditions\n+ if (child.getVisibility() == VISIBLE) {\n+ visibilities.set(i);\n+ child.setVisibility(INVISIBLE);\n+ }\n+ }\n+ }\n+\n+ int viewSaveCount = canvas.save();\n+\n+ // Scale the layer index translation by the rotation amount.\n+ float translateShowX = rotationY / ROTATION_MAX;\n+ float translateShowY = rotationX / ROTATION_MAX;\n+ float tx = layer * spacing * density * translateShowX;\n+ float ty = layer * spacing * density * translateShowY;\n+ canvas.translate(tx, -ty);\n+\n+ view.getLocationInWindow(location);\n+ canvas.translate(location[0] - x, location[1] - y);\n+\n+ viewBoundsRect.set(0, 0, view.getWidth(), view.getHeight());\n+ canvas.drawRect(viewBoundsRect, viewBorderPaint);\n+\n+ if (drawViews) {\n+ view.draw(canvas);\n+ }\n+\n+ if (drawIds) {\n+ int id = view.getId();\n+ if (id != NO_ID) {\n+ canvas.drawText(nameForId(id), textOffset, textSize, viewBorderPaint);\n+ }\n+ }\n+\n+ canvas.restoreToCount(viewSaveCount);\n+\n+ // Restore any hidden children and queue them for later drawing.\n+ if (view instanceof ViewGroup) {\n+ ViewGroup viewGroup = (ViewGroup) view;\n+ for (int i = 0, count = viewGroup.getChildCount(); i < count; i++) {\n+ if (visibilities.get(i)) {\n+ View child = viewGroup.getChildAt(i);\n+ //noinspection ConstantConditions\n+ child.setVisibility(VISIBLE);\n+ LayeredView childLayeredView = layeredViewPool.obtain();\n+ childLayeredView.set(child, layer + 1);\n+ layeredViewQueue.add(childLayeredView);\n+ }\n+ }\n+ }\n+ }\n+\n+ canvas.restoreToCount(saveCount);\n+ }\n+\n+ private String nameForId(int id) {\n+ String name = idNames.get(id);\n+ if (name == null) {\n+ try {\n+ name = res.getResourceEntryName(id);\n+ } catch (NotFoundException e) {\n+ name = String.format(\"0x%8x\", id);\n+ }\n+ idNames.put(id, name);\n+ }\n+ return name;\n+ }\n+\n+ private static abstract class Pool<T> {\n+ private final Deque<T> pool;\n+\n+ Pool(int initialSize) {\n+ pool = new ArrayDeque<>(initialSize);\n+ for (int i = 0; i < initialSize; i++) {\n+ pool.addLast(newObject());\n+ }\n+ }\n+\n+ T obtain() {\n+ return pool.isEmpty() ? newObject() : pool.removeLast();\n+ }\n+\n+ void restore(T instance) {\n+ pool.addLast(instance);\n+ }\n+\n+ protected abstract T newObject();\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ShakeDetector.java",
"diff": "+package ru.surfstudio.android.animations.sample;\n+\n+import android.hardware.Sensor;\n+import android.hardware.SensorEvent;\n+import android.hardware.SensorEventListener;\n+import android.hardware.SensorManager;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+/**\n+ * Detects phone shaking. If more than 75% of the samples taken in the past 0.5s are\n+ * accelerating, the device is a) shaking, or b) free falling 1.84m (h =\n+ * 1/2*g*t^2*3/4).\n+ *\n+ * @author Bob Lee (bob@squareup.com)\n+ * @author Eric Burke (eric@squareup.com)\n+ */\n+public class ShakeDetector implements SensorEventListener {\n+\n+ public static final int SENSITIVITY_LIGHT = 11;\n+ public static final int SENSITIVITY_MEDIUM = 13;\n+ public static final int SENSITIVITY_HARD = 15;\n+\n+ private static final int DEFAULT_ACCELERATION_THRESHOLD = SENSITIVITY_MEDIUM;\n+\n+ /**\n+ * When the magnitude of total acceleration exceeds this\n+ * value, the phone is accelerating.\n+ */\n+ private int accelerationThreshold = DEFAULT_ACCELERATION_THRESHOLD;\n+\n+ /**\n+ * Listens for shakes.\n+ */\n+ public interface Listener {\n+ /**\n+ * Called on the main thread when the device is shaken.\n+ */\n+ void hearShake();\n+ }\n+\n+ private final SampleQueue queue = new SampleQueue();\n+ private final Listener listener;\n+\n+ private SensorManager sensorManager;\n+ private Sensor accelerometer;\n+\n+ public ShakeDetector(Listener listener) {\n+ this.listener = listener;\n+ }\n+\n+ /**\n+ * Starts listening for shakes on devices with appropriate hardware.\n+ *\n+ * @return true if the device supports shake detection.\n+ */\n+ public boolean start(SensorManager sensorManager) {\n+ // Already started?\n+ if (accelerometer != null) {\n+ return true;\n+ }\n+\n+ accelerometer = sensorManager.getDefaultSensor(\n+ Sensor.TYPE_ACCELEROMETER);\n+\n+ // If this phone has an accelerometer, listen to it.\n+ if (accelerometer != null) {\n+ this.sensorManager = sensorManager;\n+ sensorManager.registerListener(this, accelerometer,\n+ SensorManager.SENSOR_DELAY_FASTEST);\n+ }\n+ return accelerometer != null;\n+ }\n+\n+ /**\n+ * Stops listening. Safe to call when already stopped. Ignored on devices\n+ * without appropriate hardware.\n+ */\n+ public void stop() {\n+ if (accelerometer != null) {\n+ queue.clear();\n+ sensorManager.unregisterListener(this, accelerometer);\n+ sensorManager = null;\n+ accelerometer = null;\n+ }\n+ }\n+\n+ @Override\n+ public void onSensorChanged(SensorEvent event) {\n+ boolean accelerating = isAccelerating(event);\n+ long timestamp = event.timestamp;\n+ queue.add(timestamp, accelerating);\n+ if (queue.isShaking()) {\n+ queue.clear();\n+ listener.hearShake();\n+ }\n+ }\n+\n+ /**\n+ * Returns true if the device is currently accelerating.\n+ */\n+ private boolean isAccelerating(SensorEvent event) {\n+ float ax = event.values[0];\n+ float ay = event.values[1];\n+ float az = event.values[2];\n+\n+ // Instead of comparing magnitude to ACCELERATION_THRESHOLD,\n+ // compare their squares. This is equivalent and doesn't need the\n+ // actual magnitude, which would be computed using (expensive) Math.sqrt().\n+ final double magnitudeSquared = ax * ax + ay * ay + az * az;\n+ return magnitudeSquared > accelerationThreshold * accelerationThreshold;\n+ }\n+\n+ /**\n+ * Sets the acceleration threshold sensitivity.\n+ */\n+ public void setSensitivity(int accelerationThreshold) {\n+ this.accelerationThreshold = accelerationThreshold;\n+ }\n+\n+ /**\n+ * Queue of samples. Keeps a running average.\n+ */\n+ static class SampleQueue {\n+\n+ /**\n+ * Window size in ns. Used to compute the average.\n+ */\n+ private static final long MAX_WINDOW_SIZE = 500000000; // 0.5s\n+ private static final long MIN_WINDOW_SIZE = MAX_WINDOW_SIZE >> 1; // 0.25s\n+\n+ /**\n+ * Ensure the queue size never falls below this size, even if the device\n+ * fails to deliver this many events during the time window. The LG Ally\n+ * is one such device.\n+ */\n+ private static final int MIN_QUEUE_SIZE = 4;\n+\n+ private final SamplePool pool = new SamplePool();\n+\n+ private Sample oldest;\n+ private Sample newest;\n+ private int sampleCount;\n+ private int acceleratingCount;\n+\n+ /**\n+ * Adds a sample.\n+ *\n+ * @param timestamp in nanoseconds of sample\n+ * @param accelerating true if > {@link #accelerationThreshold}.\n+ */\n+ void add(long timestamp, boolean accelerating) {\n+ // Purge samples that proceed window.\n+ purge(timestamp - MAX_WINDOW_SIZE);\n+\n+ // Add the sample to the queue.\n+ Sample added = pool.acquire();\n+ added.timestamp = timestamp;\n+ added.accelerating = accelerating;\n+ added.next = null;\n+ if (newest != null) {\n+ newest.next = added;\n+ }\n+ newest = added;\n+ if (oldest == null) {\n+ oldest = added;\n+ }\n+\n+ // Update running average.\n+ sampleCount++;\n+ if (accelerating) {\n+ acceleratingCount++;\n+ }\n+ }\n+\n+ /**\n+ * Removes all samples from this queue.\n+ */\n+ void clear() {\n+ while (oldest != null) {\n+ Sample removed = oldest;\n+ oldest = removed.next;\n+ pool.release(removed);\n+ }\n+ newest = null;\n+ sampleCount = 0;\n+ acceleratingCount = 0;\n+ }\n+\n+ /**\n+ * Purges samples with timestamps older than cutoff.\n+ */\n+ void purge(long cutoff) {\n+ while (sampleCount >= MIN_QUEUE_SIZE\n+ && oldest != null && cutoff - oldest.timestamp > 0) {\n+ // Remove sample.\n+ Sample removed = oldest;\n+ if (removed.accelerating) {\n+ acceleratingCount--;\n+ }\n+ sampleCount--;\n+\n+ oldest = removed.next;\n+ if (oldest == null) {\n+ newest = null;\n+ }\n+ pool.release(removed);\n+ }\n+ }\n+\n+ /**\n+ * Copies the samples into a list, with the oldest entry at index 0.\n+ */\n+ List<Sample> asList() {\n+ List<Sample> list = new ArrayList<Sample>();\n+ Sample s = oldest;\n+ while (s != null) {\n+ list.add(s);\n+ s = s.next;\n+ }\n+ return list;\n+ }\n+\n+ /**\n+ * Returns true if we have enough samples and more than 3/4 of those samples\n+ * are accelerating.\n+ */\n+ boolean isShaking() {\n+ return newest != null\n+ && oldest != null\n+ && newest.timestamp - oldest.timestamp >= MIN_WINDOW_SIZE\n+ && acceleratingCount >= (sampleCount >> 1) + (sampleCount >> 2);\n+ }\n+ }\n+\n+ /**\n+ * An accelerometer sample.\n+ */\n+ static class Sample {\n+ /**\n+ * Time sample was taken.\n+ */\n+ long timestamp;\n+\n+ /**\n+ * If acceleration > {@link #accelerationThreshold}.\n+ */\n+ boolean accelerating;\n+\n+ /**\n+ * Next sample in the queue or pool.\n+ */\n+ Sample next;\n+ }\n+\n+ /**\n+ * Pools samples. Avoids garbage collection.\n+ */\n+ static class SamplePool {\n+ private Sample head;\n+\n+ /**\n+ * Acquires a sample from the pool.\n+ */\n+ Sample acquire() {\n+ Sample acquired = head;\n+ if (acquired == null) {\n+ acquired = new Sample();\n+ } else {\n+ // Remove instance from pool.\n+ head = acquired.next;\n+ }\n+ return acquired;\n+ }\n+\n+ /**\n+ * Returns a sample to the pool.\n+ */\n+ void release(Sample sample) {\n+ sample.next = head;\n+ head = sample;\n+ }\n+ }\n+\n+ @Override\n+ public void onAccuracyChanged(Sensor sensor, int accuracy) {\n+ }\n+}\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add test scalpel layout |
652,323 | 29.12.2018 18:07:36 | -10,800 | 59b8f67a1116c07df6ff5be164c6e4b33c03b6cc | add mail scalpel logic | [
{
"change_type": "MODIFY",
"old_path": "animations-sample/build.gradle",
"new_path": "animations-sample/build.gradle",
"diff": "@@ -9,5 +9,6 @@ android {\ndependencies {\nimplementation project(':animations')\nimplementation project(':sample-common')\n+ implementation project(':sample-dagger')\nimplementation 'com.jakewharton.scalpel:scalpel:1.1.2'\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "animations-sample/src/main/AndroidManifest.xml",
"new_path": "animations-sample/src/main/AndroidManifest.xml",
"diff": "android:label=\"@string/app_name\"\nandroid:roundIcon=\"@mipmap/ic_launcher_round\"\nandroid:supportsRtl=\"true\"\n+ android:name=\"ru.surfstudio.android.sample.dagger.app.DefaultApp\"\nandroid:theme=\"@style/AppTheme\">\n<activity android:name=\".MainActivity\">\n<intent-filter>\n"
},
{
"change_type": "MODIFY",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"diff": "package ru.surfstudio.android.animations.sample\n+import android.app.Activity\n+import android.app.Application\n+import android.hardware.SensorManager\nimport android.os.Bundle\nimport android.os.Handler\nimport android.util.Log\n@@ -9,10 +12,12 @@ import android.widget.FrameLayout\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.coordinatorlayout.widget.CoordinatorLayout\nimport com.google.android.material.snackbar.Snackbar\n-import com.jakewharton.scalpel.ScalpelFrameLayout\nimport kotlinx.android.synthetic.main.activity_main.*\nimport ru.surfstudio.android.animations.anim.*\nimport ru.surfstudio.android.animations.behaviors.BottomButtonBehavior\n+import ru.surfstudio.android.core.app.DefaultActivityLifecycleCallbacks\n+import ru.surfstudio.android.sample.dagger.app.DefaultApp\n+import java.util.logging.Logger\nclass MainActivity : AppCompatActivity() {\n@@ -20,7 +25,9 @@ class MainActivity : AppCompatActivity() {\nsuper.onCreate(savedInstanceState)\nsetContentView(R.layout.activity_main)\n- Handler().postDelayed({\n+ val scalpelEnabled = false\n+\n+ val shakeDetector = ShakeDetector {\nval scalpel = ScalpelFrameLayout(this)\nval content = this.findViewById<ViewGroup>(android.R.id.content)\nval childViews = (0..content.childCount - 1)\n@@ -33,10 +40,29 @@ class MainActivity : AppCompatActivity() {\nFrameLayout.LayoutParams.MATCH_PARENT))\nchildViews.forEach { scalpel.addView(it) }\nscalpel.isLayerInteractionEnabled = true\n+ //scalpel.setDrawIds(true)\n+ ru.surfstudio.android.logger.Logger.d(\"AAA\", \"Shake\")\n+ }\n+ val app = (this.applicationContext as DefaultApp)\n+ app.registerActivityLifecycleCallbacks(object : DefaultActivityLifecycleCallbacks() {\n+ override fun onActivityResumed(activity: Activity) {\n+ shakeDetector.start(app.getSystemService(SENSOR_SERVICE) as SensorManager)\n+ shakeDetector.setSensitivity(ShakeDetector.SENSITIVITY_LIGHT)\n+ }\n+\n+ override fun onActivityPaused(activity: Activity) {\n+ shakeDetector.stop()\n+\n+ }\n+ })\n+\n+ Handler().postDelayed({\n+\n}, 1000)\n+\nval params = bottom_btn.layoutParams as CoordinatorLayout.LayoutParams\nparams.behavior = BottomButtonBehavior()\n"
},
{
"change_type": "MODIFY",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelFrameLayout.java",
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelFrameLayout.java",
"diff": "@@ -8,8 +8,6 @@ import android.graphics.Canvas;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\n-import android.graphics.Typeface;\n-import android.os.Build;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.util.SparseArray;\n@@ -25,8 +23,6 @@ import java.util.Deque;\nimport static android.graphics.Paint.ANTI_ALIAS_FLAG;\nimport static android.graphics.Paint.Style.STROKE;\n-import static android.graphics.Typeface.NORMAL;\n-import static android.os.Build.VERSION_CODES.JELLY_BEAN;\nimport static android.view.MotionEvent.ACTION_DOWN;\nimport static android.view.MotionEvent.ACTION_POINTER_UP;\nimport static android.view.MotionEvent.INVALID_POINTER_ID;\n@@ -52,13 +48,16 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate static final float ZOOM_DEFAULT = 0.6f;\nprivate static final float ZOOM_MIN = 0.33f;\nprivate static final float ZOOM_MAX = 2f;\n- private static final int SPACING_DEFAULT = 25;\n+ private static final int SPACING_DEFAULT = 50;\nprivate static final int SPACING_MIN = 10;\nprivate static final int SPACING_MAX = 100;\nprivate static final int CHROME_COLOR = 0xFF888888;\nprivate static final int CHROME_SHADOW_COLOR = 0xFF000000;\n+ private static final int ID_TEXT_COLOR = 0xFF8C0000;\n+ private static final int CLASS_TEXT_COLOR = 0xFF2F006C;\nprivate static final int TEXT_OFFSET_DP = 2;\n- private static final int TEXT_SIZE_DP = 10;\n+ private static final int ID_TEXT_SIZE_DP = 10;\n+ private static final int CLASS_TEXT_SIZE_DP = 13;\nprivate static final int CHILD_COUNT_ESTIMATION = 25;\nprivate static final boolean DEBUG = false;\n@@ -83,6 +82,8 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate final Rect viewBoundsRect = new Rect();\nprivate final Paint viewBorderPaint = new Paint(ANTI_ALIAS_FLAG);\n+ private final Paint idTextPaint = new Paint(ANTI_ALIAS_FLAG);\n+ private final Paint classTextPaint = new Paint(ANTI_ALIAS_FLAG);\nprivate final Camera camera = new Camera();\nprivate final Matrix matrix = new Matrix();\nprivate final int[] location = new int[2];\n@@ -100,11 +101,13 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate final float density;\nprivate final float slop;\nprivate final float textOffset;\n- private final float textSize;\n+ private final float idTextSize;\n+ private final float classTextSize;\nprivate boolean enabled;\nprivate boolean drawViews = true;\nprivate boolean drawIds;\n+ private boolean drawViewClasses = true;\nprivate int pointerOne = INVALID_POINTER_ID;\nprivate float lastOneX;\n@@ -136,16 +139,26 @@ public class ScalpelFrameLayout extends FrameLayout {\ndensity = context.getResources().getDisplayMetrics().density;\nslop = ViewConfiguration.get(context).getScaledTouchSlop();\n- textSize = TEXT_SIZE_DP * density;\n+ idTextSize = ID_TEXT_SIZE_DP * density;\n+ classTextSize = CLASS_TEXT_SIZE_DP * density;\ntextOffset = TEXT_OFFSET_DP * density;\nsetChromeColor(CHROME_COLOR);\nviewBorderPaint.setStyle(STROKE);\n- viewBorderPaint.setTextSize(textSize);\n+ //viewBorderPaint.setTextSize(idTextSize);\n+ idTextPaint.setStyle(STROKE);\n+ idTextPaint.setTextSize(idTextSize);\n+ idTextPaint.setColor(ID_TEXT_COLOR);\n+\n+ classTextPaint.setStyle(STROKE);\n+ classTextPaint.setTextSize(classTextSize);\n+ classTextPaint.setColor(CLASS_TEXT_COLOR);\n+\nsetChromeShadowColor(CHROME_SHADOW_COLOR);\n- if (Build.VERSION.SDK_INT >= JELLY_BEAN) {\n+\n+ /*if (Build.VERSION.SDK_INT >= JELLY_BEAN) {\nviewBorderPaint.setTypeface(Typeface.create(\"sans-serif-condensed\", NORMAL));\n- }\n+ }*/\n}\n/**\n@@ -219,6 +232,25 @@ public class ScalpelFrameLayout extends FrameLayout {\nreturn drawViews;\n}\n+\n+ /**\n+ * Set whether the view layers draw their Class.\n+ */\n+ public void setDrawViewClasses(boolean drawClass) {\n+ if (this.drawViewClasses != drawViewClasses) {\n+ this.drawViewClasses = drawClass;\n+ invalidate();\n+ }\n+ }\n+\n+ /**\n+ * Returns true when view layers draw their contents.\n+ */\n+ public boolean isDrawingViewClasses() {\n+ return drawViewClasses;\n+ }\n+\n+\n/**\n* Set whether the view layers draw their IDs.\n*/\n@@ -463,10 +495,15 @@ public class ScalpelFrameLayout extends FrameLayout {\nif (drawIds) {\nint id = view.getId();\nif (id != NO_ID) {\n- canvas.drawText(nameForId(id), textOffset, textSize, viewBorderPaint);\n+ canvas.drawText(nameForId(id), textOffset, -textOffset, idTextPaint);\n}\n}\n+ if (drawViewClasses) {\n+ float yOffset = (drawIds ? idTextSize : 0) + textOffset;\n+ canvas.drawText(view.getClass().getSimpleName(), textOffset, -yOffset, classTextPaint);\n+ }\n+\ncanvas.restoreToCount(viewSaveCount);\n// Restore any hidden children and queue them for later drawing.\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelManager.kt",
"diff": "+package ru.surfstudio.android.animations.sample\n+\n+import android.app.Activity\n+import android.app.Application\n+import android.hardware.SensorManager\n+import android.util.Log\n+import android.view.ViewGroup\n+import android.widget.FrameLayout\n+import androidx.appcompat.app.AppCompatActivity\n+import io.reactivex.subjects.PublishSubject\n+import ru.surfstudio.android.core.app.DefaultActivityLifecycleCallbacks\n+import java.util.concurrent.TimeUnit\n+\n+class ScalpelManager {\n+ val shakeDetectedSubject = PublishSubject.create<Long>()\n+ var currentActivity : Activity? = null\n+\n+ lateinit var shakeDetector : ShakeDetector\n+\n+ fun init(app: Application){\n+\n+ initShakeDetector()\n+ listenActivityLifecycle(app)\n+ listenShake()\n+ }\n+\n+ private fun initShakeDetector() {\n+ shakeDetector = ShakeDetector {\n+ shakeDetectedSubject.onNext(System.currentTimeMillis())\n+ val scalpel = ScalpelFrameLayout(this)\n+ val content = this.findViewById<ViewGroup>(android.R.id.content)\n+ val childViews = (0..content.childCount - 1)\n+ .map { content.getChildAt(it) }\n+ .toList()\n+ Log.d(\"AAA\", childViews.toString())\n+ content.removeAllViews()\n+ content.addView(scalpel,\n+ FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,\n+ FrameLayout.LayoutParams.MATCH_PARENT))\n+ childViews.forEach { scalpel.addView(it) }\n+ scalpel.isLayerInteractionEnabled = true\n+ //scalpel.setDrawIds(true)\n+ ru.surfstudio.android.logger.Logger.d(\"AAA\", \"Shake\")\n+ }\n+ shakeDetector.setSensitivity(ShakeDetector.SENSITIVITY_MEDIUM)\n+ }\n+\n+ private fun listenShake() {\n+ shakeDetectedSubject.buffer(1000, TimeUnit.MILLISECONDS)\n+ .subscribe {\n+ if (it.size >= 3) {\n+ toggleScalpel()\n+ }\n+ }\n+ }\n+\n+ private fun toggleScalpel() {\n+\n+\n+ }\n+\n+ private fun listenActivityLifecycle(app: Application) {\n+ app.registerActivityLifecycleCallbacks(object : DefaultActivityLifecycleCallbacks() {\n+ override fun onActivityResumed(activity: Activity) {\n+ currentActivity = activity\n+ shakeDetector.start(app.getSystemService(AppCompatActivity.SENSOR_SERVICE) as SensorManager)\n+ }\n+\n+ override fun onActivityPaused(activity: Activity) {\n+ currentActivity = null\n+ shakeDetector.stop()\n+\n+ }\n+ })\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelWidget.kt",
"diff": "+package ru.surfstudio.android.animations.sample\n+\n+import android.content.Context\n+import android.widget.FrameLayout\n+\n+class ScalpelWidget(val context: Context) : FrameLayout(context) {\n+}\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add mail scalpel logic |
652,323 | 06.01.2019 16:21:16 | -10,800 | 26338a4c30a35eeaaac1198403efcc6766d2ec48 | add scalpel functionality | [
{
"change_type": "DELETE",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelManager.kt",
"new_path": null,
"diff": "-package ru.surfstudio.android.animations.sample\n-\n-import android.app.Activity\n-import android.app.Application\n-import android.hardware.SensorManager\n-import android.util.Log\n-import android.view.ViewGroup\n-import android.widget.FrameLayout\n-import androidx.appcompat.app.AppCompatActivity\n-import io.reactivex.subjects.PublishSubject\n-import ru.surfstudio.android.core.app.DefaultActivityLifecycleCallbacks\n-import java.util.concurrent.TimeUnit\n-\n-class ScalpelManager {\n- val shakeDetectedSubject = PublishSubject.create<Long>()\n- var currentActivity : Activity? = null\n-\n- lateinit var shakeDetector : ShakeDetector\n-\n- fun init(app: Application){\n-\n- initShakeDetector()\n- listenActivityLifecycle(app)\n- listenShake()\n- }\n-\n- private fun initShakeDetector() {\n- shakeDetector = ShakeDetector {\n- shakeDetectedSubject.onNext(System.currentTimeMillis())\n- val scalpel = ScalpelFrameLayout(this)\n- val content = this.findViewById<ViewGroup>(android.R.id.content)\n- val childViews = (0..content.childCount - 1)\n- .map { content.getChildAt(it) }\n- .toList()\n- Log.d(\"AAA\", childViews.toString())\n- content.removeAllViews()\n- content.addView(scalpel,\n- FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,\n- FrameLayout.LayoutParams.MATCH_PARENT))\n- childViews.forEach { scalpel.addView(it) }\n- scalpel.isLayerInteractionEnabled = true\n- //scalpel.setDrawIds(true)\n- ru.surfstudio.android.logger.Logger.d(\"AAA\", \"Shake\")\n- }\n- shakeDetector.setSensitivity(ShakeDetector.SENSITIVITY_MEDIUM)\n- }\n-\n- private fun listenShake() {\n- shakeDetectedSubject.buffer(1000, TimeUnit.MILLISECONDS)\n- .subscribe {\n- if (it.size >= 3) {\n- toggleScalpel()\n- }\n- }\n- }\n-\n- private fun toggleScalpel() {\n-\n-\n- }\n-\n- private fun listenActivityLifecycle(app: Application) {\n- app.registerActivityLifecycleCallbacks(object : DefaultActivityLifecycleCallbacks() {\n- override fun onActivityResumed(activity: Activity) {\n- currentActivity = activity\n- shakeDetector.start(app.getSystemService(AppCompatActivity.SENSOR_SERVICE) as SensorManager)\n- }\n-\n- override fun onActivityPaused(activity: Activity) {\n- currentActivity = null\n- shakeDetector.stop()\n-\n- }\n- })\n- }\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "config.gradle",
"new_path": "config.gradle",
"diff": "@@ -98,4 +98,5 @@ ext {\nprocessPhoenix = '2.0.0' //https://bit.ly/2OAc0po\nanrWatchDogVersion = '1.3.0' //http://bit.ly/2NZvjZc\ntimberVersion = '4.7.1' //http://bit.ly/2LWbLaY\n+ materialRangebarVersion = '1.4.4' //https://bit.ly/2TxqAkm\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/config.gradle",
"new_path": "template/config.gradle",
"diff": "@@ -92,6 +92,7 @@ ext {\ntimberVersion = '4.7.1' //http://bit.ly/2LWbLaY\nchuckVersion = '1.1.0' //https://bit.ly/2qCecTE\nanrWatchDogVersion = '1.3.0' //http://bit.ly/2NZvjZc\n+ materialRangebarVersion = '1.4.4' //https://bit.ly/2TxqAkm\ntimberVersion = '4.7.1' //http://bit.ly/2LWbLaY\ntemplatePrefix=':template'\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/build.gradle",
"new_path": "template/f-debug/build.gradle",
"diff": "@@ -22,4 +22,7 @@ dependencies {\n//stetho\nimplementation \"com.facebook.stetho:stetho:${stethoVersion}\"\nimplementation \"com.facebook.stetho:stetho-okhttp3:${stethoVersion}\"\n+\n+ //rangebar\n+ implementation \"com.appyvet:materialrangebar:${materialRangebarVersion}\"\n}\n\\ No newline at end of file\n"
},
{
"change_type": "RENAME",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelFrameLayout.java",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/scalpel/ScalpelFrameLayout.java",
"diff": "-package ru.surfstudio.android.animations.sample;\n+package ru.surfstudio.standard.f_debug.scalpel;\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.content.res.Resources.NotFoundException;\nimport android.graphics.Camera;\nimport android.graphics.Canvas;\n+import android.graphics.Color;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\n+import android.graphics.Typeface;\n+import android.os.Build;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.util.SparseArray;\n@@ -23,6 +26,8 @@ import java.util.Deque;\nimport static android.graphics.Paint.ANTI_ALIAS_FLAG;\nimport static android.graphics.Paint.Style.STROKE;\n+import static android.graphics.Typeface.NORMAL;\n+import static android.os.Build.VERSION_CODES.JELLY_BEAN;\nimport static android.view.MotionEvent.ACTION_DOWN;\nimport static android.view.MotionEvent.ACTION_POINTER_UP;\nimport static android.view.MotionEvent.INVALID_POINTER_ID;\n@@ -36,6 +41,8 @@ import static android.view.MotionEvent.INVALID_POINTER_ID;\n* <li>Two finger vertical pinch: Adjust zoom.</li>\n* <li>Two finger horizontal pinch: Adjust layer spacing.</li>\n* </ul>\n+ *\n+ * Changed By Surf\n*/\npublic class ScalpelFrameLayout extends FrameLayout {\nprivate static final int TRACKING_UNKNOWN = 0;\n@@ -53,8 +60,6 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate static final int SPACING_MAX = 100;\nprivate static final int CHROME_COLOR = 0xFF888888;\nprivate static final int CHROME_SHADOW_COLOR = 0xFF000000;\n- private static final int ID_TEXT_COLOR = 0xFF8C0000;\n- private static final int CLASS_TEXT_COLOR = 0xFF2F006C;\nprivate static final int TEXT_OFFSET_DP = 2;\nprivate static final int ID_TEXT_SIZE_DP = 10;\nprivate static final int CLASS_TEXT_SIZE_DP = 13;\n@@ -125,6 +130,13 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate int chromeColor;\nprivate int chromeShadowColor;\n+\n+ public static final int UNSPECIFIED_END_VIEW_LAYER = -1;\n+ public static final int START_VIEW_LAYER = 0;\n+ private int endViewLayer = UNSPECIFIED_END_VIEW_LAYER;\n+ private int currentStartViewLayer = START_VIEW_LAYER;\n+ private int currentEndViewLayer = endViewLayer;\n+\npublic ScalpelFrameLayout(Context context) {\nthis(context, null);\n}\n@@ -145,20 +157,39 @@ public class ScalpelFrameLayout extends FrameLayout {\nsetChromeColor(CHROME_COLOR);\nviewBorderPaint.setStyle(STROKE);\n- //viewBorderPaint.setTextSize(idTextSize);\nidTextPaint.setStyle(STROKE);\nidTextPaint.setTextSize(idTextSize);\n- idTextPaint.setColor(ID_TEXT_COLOR);\nclassTextPaint.setStyle(STROKE);\nclassTextPaint.setTextSize(classTextSize);\n- classTextPaint.setColor(CLASS_TEXT_COLOR);\nsetChromeShadowColor(CHROME_SHADOW_COLOR);\n- /*if (Build.VERSION.SDK_INT >= JELLY_BEAN) {\n+ if (Build.VERSION.SDK_INT >= JELLY_BEAN) {\nviewBorderPaint.setTypeface(Typeface.create(\"sans-serif-condensed\", NORMAL));\n- }*/\n+ }\n+ }\n+\n+ public int getEndViewLayer() {\n+ return endViewLayer;\n+ }\n+\n+ public int getCurrentStartViewLayer() {\n+ return currentStartViewLayer;\n+ }\n+\n+ public void setCurrentStartViewLayer(int currentStartViewLayer) {\n+ this.currentStartViewLayer = currentStartViewLayer;\n+ invalidate();\n+ }\n+\n+ public int getCurrentEndViewLayer() {\n+ return currentEndViewLayer;\n+ }\n+\n+ public void setCurrentEndViewLayer(int currentEndViewLayer) {\n+ this.currentEndViewLayer = currentEndViewLayer;\n+ invalidate();\n}\n/**\n@@ -237,7 +268,7 @@ public class ScalpelFrameLayout extends FrameLayout {\n* Set whether the view layers draw their Class.\n*/\npublic void setDrawViewClasses(boolean drawClass) {\n- if (this.drawViewClasses != drawViewClasses) {\n+ if (this.drawViewClasses != drawClass) {\nthis.drawViewClasses = drawClass;\ninvalidate();\n}\n@@ -475,6 +506,18 @@ public class ScalpelFrameLayout extends FrameLayout {\nint viewSaveCount = canvas.save();\n+ int rawViewClassColor = view.getClass().getCanonicalName().hashCode() % 0xffffff;\n+\n+ int viewColor = Color.rgb(\n+ Color.red(rawViewClassColor)/2,\n+ Color.green(rawViewClassColor)/2,\n+ Color.blue(rawViewClassColor)/2\n+ );\n+\n+ viewBorderPaint.setColor(viewColor);\n+ classTextPaint.setColor(viewColor);\n+ idTextPaint.setColor(viewColor);\n+\n// Scale the layer index translation by the rotation amount.\nfloat translateShowX = rotationY / ROTATION_MAX;\nfloat translateShowY = rotationX / ROTATION_MAX;\n@@ -485,9 +528,12 @@ public class ScalpelFrameLayout extends FrameLayout {\nview.getLocationInWindow(location);\ncanvas.translate(location[0] - x, location[1] - y);\n+\nviewBoundsRect.set(0, 0, view.getWidth(), view.getHeight());\ncanvas.drawRect(viewBoundsRect, viewBorderPaint);\n+ endViewLayer = Math.max(endViewLayer, layer);\n+ if(currentStartViewLayer <= layer && (currentEndViewLayer == UNSPECIFIED_END_VIEW_LAYER || currentEndViewLayer >= layer)) {\nif (drawViews) {\nview.draw(canvas);\n}\n@@ -500,9 +546,10 @@ public class ScalpelFrameLayout extends FrameLayout {\n}\nif (drawViewClasses) {\n- float yOffset = (drawIds ? idTextSize : 0) + textOffset;\n+ float yOffset = (drawIds && view.getId() != NO_ID ? idTextSize : 0) + textOffset;\ncanvas.drawText(view.getClass().getSimpleName(), textOffset, -yOffset, classTextPaint);\n}\n+ }\ncanvas.restoreToCount(viewSaveCount);\n"
},
{
"change_type": "RENAME",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ShakeDetector.java",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/scalpel/ShakeDetector.java",
"diff": "-package ru.surfstudio.android.animations.sample;\n+package ru.surfstudio.standard.f_debug.scalpel;\nimport android.hardware.Sensor;\nimport android.hardware.SensorEvent;\n"
},
{
"change_type": "ADD",
"old_path": "template/f-debug/src/main/res/drawable-xxhdpi/ic_settings.png",
"new_path": "template/f-debug/src/main/res/drawable-xxhdpi/ic_settings.png",
"diff": "Binary files /dev/null and b/template/f-debug/src/main/res/drawable-xxhdpi/ic_settings.png differ\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/res/layout/debug_catalog_item_layout.xml",
"new_path": "template/f-debug/src/main/res/layout/debug_catalog_item_layout.xml",
"diff": "android:id=\"@+id/debug_item_tv\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"wrap_content\"\n- android:padding=\"8dp\"\n+ android:paddingLeft=\"16dp\"\n+ android:paddingRight=\"16dp\"\nandroid:layout_centerVertical=\"true\"\ntools:text=\"Text\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/res/layout/layout_title_subtitle_switch.xml",
"new_path": "template/f-debug/src/main/res/layout/layout_title_subtitle_switch.xml",
"diff": "android:id=\"@+id/title_tv\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\n- android:layout_marginStart=\"8dp\"\n+ android:layout_marginStart=\"16dp\"\nandroid:layout_marginTop=\"8dp\"\n+ android:layout_marginEnd=\"8dp\"\nandroid:textColor=\"@android:color/black\"\nandroid:textSize=\"20sp\"\napp:layout_constraintStart_toStartOf=\"parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:layout_marginBottom=\"8dp\"\nandroid:layout_marginEnd=\"8dp\"\n- android:layout_marginStart=\"8dp\"\n+ android:layout_marginStart=\"16dp\"\nandroid:textColor=\"@android:color/darker_gray\"\nandroid:textSize=\"16sp\"\napp:layout_constraintBottom_toBottomOf=\"parent\"\nandroid:id=\"@+id/value_switch\"\nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\n- android:layout_marginEnd=\"8dp\"\n+ android:layout_marginEnd=\"16dp\"\napp:layout_constraintBottom_toBottomOf=\"parent\"\napp:layout_constraintEnd_toEndOf=\"parent\"\napp:layout_constraintTop_toTopOf=\"parent\" />\n+ <View\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"1dp\"\n+ android:background=\"@android:color/darker_gray\"\n+ android:layout_below=\"@id/scalpel_settings_container\"\n+ app:layout_constraintBottom_toBottomOf=\"parent\"/>\n+\n</androidx.constraintlayout.widget.ConstraintLayout>\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/f-debug/src/main/res/layout/scalpel_widget_layout.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"utf-8\"?>\n+<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n+ xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n+ <LinearLayout\n+ android:id=\"@+id/scalpel_panel\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"40dp\"\n+ android:background=\"?attr/selectableItemBackground\">\n+ <ImageView\n+ android:layout_width=\"40dp\"\n+ android:layout_height=\"40dp\"\n+ android:src=\"@drawable/ic_settings\"\n+ android:padding=\"8dp\"\n+ android:layout_weight=\"0\"/>\n+ <TextView\n+ android:layout_width=\"0dp\"\n+ android:layout_height=\"match_parent\"\n+ android:gravity=\"center_vertical\"\n+ android:text=\"Scalpel\"\n+ android:textSize=\"20sp\"\n+ android:layout_weight=\"1\"/>\n+ <TextView\n+ android:id=\"@+id/close_scalpel_btn\"\n+ android:layout_width=\"wrap_content\"\n+ android:layout_height=\"match_parent\"\n+ android:layout_weight=\"0\"\n+ android:text=\"CLOSE\"\n+ android:textSize=\"18sp\"\n+ android:paddingLeft=\"10dp\"\n+ android:paddingRight=\"10dp\"\n+ android:textColor=\"#FF0025CC\"\n+ android:gravity=\"center\"\n+ android:background=\"?attr/selectableItemBackground\"/>\n+ </LinearLayout>\n+ <ru.surfstudio.standard.f_debug.scalpel.ScalpelFrameLayout\n+ android:id=\"@+id/scalpel\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"match_parent\"\n+ android:layout_below=\"@+id/scalpel_panel\"/>\n+ <LinearLayout\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ android:orientation=\"vertical\"\n+ android:visibility=\"gone\"\n+ android:id=\"@+id/scalpel_settings_container\"\n+ android:layout_below=\"@+id/scalpel_panel\"\n+ android:background=\"@android:color/white\"\n+ android:alpha=\"0.8\">\n+ <View\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"1dp\"\n+ android:background=\"@android:color/darker_gray\"\n+ android:layout_below=\"@id/scalpel_settings_container\"/>\n+ <ru.surfstudio.standard.f_debug.common_widgets.TitleSubtitleSwitch\n+ android:id=\"@+id/draw_class_scalpel_settings\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ app:switch_title=\"Show View classes\"/>\n+ <ru.surfstudio.standard.f_debug.common_widgets.TitleSubtitleSwitch\n+ android:id=\"@+id/draw_id_scalpel_settings\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ app:switch_title=\"Show View ids\"/>\n+ <ru.surfstudio.standard.f_debug.common_widgets.TitleSubtitleSwitch\n+ android:id=\"@+id/draw_views_scalpel_settings\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ app:switch_title=\"Draw Views content\"/>\n+ <TextView\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ android:text=\"Visible Layers:\"\n+ android:layout_marginLeft=\"16dp\"\n+ android:paddingTop=\"8dp\"/>\n+\n+ <com.appyvet.materialrangebar.RangeBar\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ android:id=\"@+id/views_layers_scalpel_settings\"\n+ android:layout_marginRight=\"16dp\"\n+ android:layout_marginLeft=\"16dp\"\n+ app:mrb_pinMinFont=\"12sp\"\n+ app:mrb_pinMaxFont=\"14sp\"\n+ app:mrb_tickEnd=\"1\"/>\n+\n+ <View\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"1dp\"\n+ android:background=\"@android:color/darker_gray\"\n+ android:layout_below=\"@id/scalpel_settings_container\"/>\n+\n+ <TextView\n+ android:id=\"@+id/hide_scalpel_settings_btn\"\n+ android:layout_width=\"wrap_content\"\n+ android:layout_height=\"wrap_content\"\n+ android:gravity=\"center\"\n+ android:text=\"HIDE\"\n+ android:textSize=\"20sp\"\n+ android:padding=\"10dp\"\n+ android:textColor=\"#FF0025CC\"\n+ android:background=\"?attr/selectableItemBackground\"\n+ android:layout_gravity=\"right\"\n+ android:layout_marginRight=\"6dp\"/>\n+ </LinearLayout>\n+ <View\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"1dp\"\n+ android:background=\"@android:color/darker_gray\"\n+ android:layout_below=\"@id/scalpel_settings_container\"/>\n+\n+\n+</merge>\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add scalpel functionality |
652,323 | 06.01.2019 16:51:08 | -10,800 | c544e66021f7320602790071051b0b9e2c39efd6 | refactor, remove test code | [
{
"change_type": "MODIFY",
"old_path": "animations-sample/build.gradle",
"new_path": "animations-sample/build.gradle",
"diff": "@@ -10,5 +10,4 @@ dependencies {\nimplementation project(':animations')\nimplementation project(':sample-common')\nimplementation project(':sample-dagger')\n- implementation 'com.jakewharton.scalpel:scalpel:1.1.2'\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"new_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/MainActivity.kt",
"diff": "package ru.surfstudio.android.animations.sample\n-import android.app.Activity\n-import android.app.Application\n-import android.hardware.SensorManager\nimport android.os.Bundle\n-import android.os.Handler\n-import android.util.Log\nimport android.view.Gravity\n-import android.view.ViewGroup\n-import android.widget.FrameLayout\nimport androidx.appcompat.app.AppCompatActivity\nimport androidx.coordinatorlayout.widget.CoordinatorLayout\nimport com.google.android.material.snackbar.Snackbar\nimport kotlinx.android.synthetic.main.activity_main.*\nimport ru.surfstudio.android.animations.anim.*\nimport ru.surfstudio.android.animations.behaviors.BottomButtonBehavior\n-import ru.surfstudio.android.core.app.DefaultActivityLifecycleCallbacks\n-import ru.surfstudio.android.sample.dagger.app.DefaultApp\n-import java.util.logging.Logger\nclass MainActivity : AppCompatActivity() {\n@@ -25,44 +15,6 @@ class MainActivity : AppCompatActivity() {\nsuper.onCreate(savedInstanceState)\nsetContentView(R.layout.activity_main)\n- val scalpelEnabled = false\n-\n- val shakeDetector = ShakeDetector {\n- val scalpel = ScalpelFrameLayout(this)\n- val content = this.findViewById<ViewGroup>(android.R.id.content)\n- val childViews = (0..content.childCount - 1)\n- .map { content.getChildAt(it) }\n- .toList()\n- Log.d(\"AAA\", childViews.toString())\n- content.removeAllViews()\n- content.addView(scalpel,\n- FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,\n- FrameLayout.LayoutParams.MATCH_PARENT))\n- childViews.forEach { scalpel.addView(it) }\n- scalpel.isLayerInteractionEnabled = true\n- //scalpel.setDrawIds(true)\n- ru.surfstudio.android.logger.Logger.d(\"AAA\", \"Shake\")\n- }\n- val app = (this.applicationContext as DefaultApp)\n- app.registerActivityLifecycleCallbacks(object : DefaultActivityLifecycleCallbacks() {\n- override fun onActivityResumed(activity: Activity) {\n- shakeDetector.start(app.getSystemService(SENSOR_SERVICE) as SensorManager)\n- shakeDetector.setSensitivity(ShakeDetector.SENSITIVITY_LIGHT)\n- }\n-\n- override fun onActivityPaused(activity: Activity) {\n- shakeDetector.stop()\n-\n- }\n- })\n-\n- Handler().postDelayed({\n-\n- }, 1000)\n-\n-\n-\n-\nval params = bottom_btn.layoutParams as CoordinatorLayout.LayoutParams\nparams.behavior = BottomButtonBehavior()\n"
},
{
"change_type": "DELETE",
"old_path": "animations-sample/src/main/java/ru/surfstudio/android/animations/sample/ScalpelWidget.kt",
"new_path": null,
"diff": "-package ru.surfstudio.android.animations.sample\n-\n-import android.content.Context\n-import android.widget.FrameLayout\n-\n-class ScalpelWidget(val context: Context) : FrameLayout(context) {\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/scalpel/ScalpelFrameLayout.java",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/scalpel/ScalpelFrameLayout.java",
"diff": "@@ -57,7 +57,7 @@ public class ScalpelFrameLayout extends FrameLayout {\nprivate static final float ZOOM_MAX = 2f;\nprivate static final int SPACING_DEFAULT = 50;\nprivate static final int SPACING_MIN = 10;\n- private static final int SPACING_MAX = 100;\n+ private static final int SPACING_MAX = 160;\nprivate static final int CHROME_COLOR = 0xFF888888;\nprivate static final int CHROME_SHADOW_COLOR = 0xFF000000;\nprivate static final int TEXT_OFFSET_DP = 2;\n@@ -506,14 +506,20 @@ public class ScalpelFrameLayout extends FrameLayout {\nint viewSaveCount = canvas.save();\n- int rawViewClassColor = view.getClass().getCanonicalName().hashCode() % 0xffffff;\n+ boolean needDrawView = currentStartViewLayer <= layer\n+ && (currentEndViewLayer == UNSPECIFIED_END_VIEW_LAYER || currentEndViewLayer >= layer);\n+ int rawViewClassColor = view.getClass().getCanonicalName().hashCode() % 0xffffff;\nint viewColor = Color.rgb(\nColor.red(rawViewClassColor)/2,\nColor.green(rawViewClassColor)/2,\nColor.blue(rawViewClassColor)/2\n);\n+ if (!needDrawView) {\n+ viewColor += 0x33000000; //add transparent to color\n+ }\n+\nviewBorderPaint.setColor(viewColor);\nclassTextPaint.setColor(viewColor);\nidTextPaint.setColor(viewColor);\n@@ -533,7 +539,7 @@ public class ScalpelFrameLayout extends FrameLayout {\ncanvas.drawRect(viewBoundsRect, viewBorderPaint);\nendViewLayer = Math.max(endViewLayer, layer);\n- if(currentStartViewLayer <= layer && (currentEndViewLayer == UNSPECIFIED_END_VIEW_LAYER || currentEndViewLayer >= layer)) {\n+ if (needDrawView) {\nif (drawViews) {\nview.draw(canvas);\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | refactor, remove test code |
652,312 | 10.01.2019 11:59:23 | -10,800 | 1086a887a1b37fe4cc3f4e28dcefcb151225ffb4 | testBuildType = release for modules | [
{
"change_type": "MODIFY",
"old_path": "androidModule.gradle",
"new_path": "androidModule.gradle",
"diff": "@@ -5,6 +5,8 @@ apply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\napply plugin: 'kotlin-kapt'\n+apply from: '../sample-keystore/signingConfigs.gradle'\n+\nandroid {\ncompileSdkVersion project.ext.compileSdkVersion\nbuildToolsVersion project.ext.buildToolsVersion\n@@ -14,6 +16,18 @@ android {\ntargetSdkVersion project.ext.targetSdkVersion\nversionCode project.ext.moduleVersionCode\nversionName project.ext.moduleVersionName\n+ testBuildType \"release\"\n+ testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n+ }\n+\n+ compileOptions {\n+ sourceCompatibility JavaVersion.VERSION_1_8\n+ targetCompatibility JavaVersion.VERSION_1_8\n+ }\n+\n+ lintOptions {\n+ checkReleaseBuilds false\n+ abortOnError false\n}\nbuildTypes {\n@@ -24,18 +38,9 @@ android {\nrelease {\nminifyEnabled false\n+ signingConfig signingConfigs.release\n}\n}\n-\n- compileOptions {\n- sourceCompatibility JavaVersion.VERSION_1_8\n- targetCompatibility JavaVersion.VERSION_1_8\n- }\n-\n- lintOptions {\n- checkReleaseBuilds false\n- abortOnError false\n- }\n}\ndependencies {\n"
},
{
"change_type": "MODIFY",
"old_path": "imageloader-sample/build.gradle",
"new_path": "imageloader-sample/build.gradle",
"diff": "@@ -2,7 +2,7 @@ apply from: '../androidSample.gradle'\nandroid {\ndefaultConfig {\n- applicationId \"ru.surfstudio.android.custom_view_sample\"\n+ applicationId \"ru.surfstudio.android.imageloader_sample\"\n}\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-383 testBuildType = release for modules |
652,312 | 10.01.2019 13:29:28 | -10,800 | f5bf4744279bf8371e816fe35fd24181483c7e4f | switch to android-2 node | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -5,7 +5,6 @@ import ru.surfstudio.ci.pipeline.helper.AndroidPipelineHelper\nimport ru.surfstudio.ci.JarvisUtil\nimport ru.surfstudio.ci.CommonUtil\nimport ru.surfstudio.ci.RepositoryUtil\n-import ru.surfstudio.ci.NodeProvider\nimport ru.surfstudio.ci.utils.android.AndroidUtil\nimport ru.surfstudio.ci.Result\nimport ru.surfstudio.ci.AbortDuplicateStrategy\n@@ -53,7 +52,7 @@ def pipeline = new EmptyScmPipeline(script)\npipeline.init()\n//configuration\n-pipeline.node = NodeProvider.getAndroidNode()\n+pipeline.node = \"android-2\"\npipeline.preExecuteStageBody = { stage ->\nif(stage.name != CHECKOUT) RepositoryUtil.notifyBitbucketAboutStageStart(script, pipeline.repoUrl, stage.name)\n"
},
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"new_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"diff": "@@ -7,6 +7,7 @@ def pipeline = new PrPipelineAndroid(this)\npipeline.init()\n//customization\n+pipeline.node = \"android-2\"\npipeline.getStage(pipeline.STATIC_CODE_ANALYSIS).strategy = StageStrategy.SKIP_STAGE\npipeline.buildGradleTask = \"clean assembleRelease\"\npipeline.androidTestBuildType = \"release\"\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | switch to android-2 node |
652,323 | 10.01.2019 13:30:40 | 0 | ee4a4b80a31703c60384b2881d834cd0fabb51b1 | gradle.properties edited online with Bitbucket | [
{
"change_type": "MODIFY",
"old_path": "gradle.properties",
"new_path": "gradle.properties",
"diff": "@@ -11,6 +11,7 @@ org.gradle.jvmargs=-Xmx2048m\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n+org.gradle.parallel=true\nsurf_maven_libs_url=https://artifactory.surfstudio.ru/artifactory/libs-release-local\nandroid.useAndroidX=true\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | gradle.properties edited online with Bitbucket |
652,323 | 11.01.2019 19:33:15 | -10,800 | 0126127cc9542d91cbade1d965b28c4886099873 | add ApiTestRunner | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/ApiTestRunner.kt",
"diff": "+package ru.surfstudio.standard.util\n+\n+import org.junit.Test\n+import org.junit.runners.model.FrameworkMethod\n+import org.junit.runners.model.Statement\n+import org.robolectric.RobolectricTestRunner\n+import java.lang.RuntimeException\n+\n+class ApiTestRunner(testClass: Class<*>?) : RobolectricTestRunner(testClass) {\n+\n+ companion object {\n+ private const val CHECK_API_TESTS_CONSOLE_PARAMETER = \"check_api\" // -Dcheck_api\n+ private const val WAIT_API_TESTS_CONSOLE_PARAMETER = \"wait_api\" // -Dwait_api\n+ }\n+\n+ private var runCheckApiTests: Boolean = false\n+ private var runWaitApiTest: Boolean = false\n+\n+\n+ override fun methodBlock(method: FrameworkMethod): Statement {\n+ val defaultInvoker = super.methodBlock(method)\n+ return object : Statement() {\n+ override fun evaluate() {\n+ if (isMethodWithAnnotation(method, WaitApiTest::class.java)) {\n+ var failed = false\n+ try {\n+ defaultInvoker.evaluate()\n+ } catch (e: Throwable) {\n+ System.err.println(\"Error occurred, when test with annotation @WaitApiTest is executing. It's normal.\")\n+ e.printStackTrace()\n+ failed = true\n+ }\n+ if (!failed) {\n+ throw WaitApiTestPassExceprtion()\n+ }\n+ } else {\n+ defaultInvoker.evaluate()\n+ }\n+ }\n+ }\n+ }\n+\n+ override fun computeTestMethods(): MutableList<FrameworkMethod> {\n+ extractInputParameters()\n+ checkStandardTestMethods()\n+ val methods = mutableListOf<FrameworkMethod>()\n+ if (runCheckApiTests) {\n+ methods.addAll(testClass.getAnnotatedMethods(CheckApiTest::class.java))\n+ }\n+ if (runWaitApiTest) {\n+ methods.addAll(testClass.getAnnotatedMethods(WaitApiTest::class.java))\n+ }\n+ checkMethodsContainsStandardTestAnnotation(methods)\n+ return methods\n+ }\n+\n+ private fun checkMethodsContainsStandardTestAnnotation(methods: MutableList<FrameworkMethod>) {\n+ val badMethods = methods.asSequence().filter { !isMethodWithAnnotation(it, Test::class.java) }.toList()\n+ if (badMethods.isNotEmpty()) {\n+ val badMethodsStr = badMethods.asSequence().map { it.name }.reduce { left, right -> \"$left, $right\" }\n+ throw RuntimeException(\"Api test methods must have @test annotation. Wrong methods: $badMethodsStr\")\n+ }\n+\n+ }\n+\n+ private fun extractInputParameters() {\n+ runCheckApiTests = System.getProperty(CHECK_API_TESTS_CONSOLE_PARAMETER) != null\n+ runWaitApiTest = System.getProperty(WAIT_API_TESTS_CONSOLE_PARAMETER) != null\n+ if (!runCheckApiTests && !runWaitApiTest) {\n+ //run all when not configured via parameter\n+ runCheckApiTests = true\n+ runWaitApiTest = true\n+ }\n+ }\n+\n+ private fun checkStandardTestMethods() {\n+ val methods = testClass.getAnnotatedMethods(Test::class.java)\n+ methods.forEach {\n+ if (!isMethodWithAnnotation(it, WaitApiTest::class.java) &&\n+ !isMethodWithAnnotation(it, CheckApiTest::class.java)) {\n+ throw RuntimeException(\"Api Test class cannot contains test method without \" +\n+ \"@WaitApiTest and @CheckApiTest annotations, wrong method: \" + it.name)\n+ }\n+ }\n+ }\n+\n+ private fun isMethodWithAnnotation(method: FrameworkMethod, annotationClass: Class<out Annotation>) =\n+ method.method.declaredAnnotations.map { it.annotationClass.java }.toList().contains(annotationClass)\n+\n+\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/BaseNetworkDaggerTest.kt",
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/BaseNetworkDaggerTest.kt",
"diff": "@@ -19,9 +19,6 @@ import ru.surfstudio.android.logger.logging_strategies.impl.test.TestLoggingStra\nimport ru.surfstudio.standard.app_injector.App\nimport ru.surfstudio.standard.app_injector.AppModule\n-@RunWith(RobolectricTestRunner::class)\n-@Config(application = App::class,\n- sdk = [Build.VERSION_CODES.O_MR1])\nabstract class BaseNetworkDaggerTest {\ncompanion object {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/CheckApiTest.java",
"diff": "+package ru.surfstudio.standard.util;\n+\n+import org.junit.Test;\n+\n+import java.lang.annotation.ElementType;\n+import java.lang.annotation.Retention;\n+import java.lang.annotation.RetentionPolicy;\n+import java.lang.annotation.Target;\n+\n+import ru.surfstudio.android.core.ui.HasName;\n+\n+@Retention(RetentionPolicy.RUNTIME)\n+@Target({ElementType.METHOD})\n+public @interface CheckApiTest {\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/SampleApiTest.kt",
"diff": "+package ru.surfstudio.standard.util\n+\n+import android.os.Build\n+import org.junit.Test\n+import org.junit.runner.RunWith\n+import org.robolectric.annotation.Config\n+import ru.surfstudio.standard.app_injector.App\n+\n+@RunWith(ApiTestRunner::class)\n+@Config(application = App::class,\n+ sdk = [Build.VERSION_CODES.O_MR1])\n+class SampleApiTest : BaseNetworkDaggerTest() {\n+\n+ override fun inject(networkComponent: TestNetworkAppComponent) {\n+ networkComponent.inject(this)\n+ }\n+\n+ @Test\n+ @CheckApiTest\n+ fun testOne() {\n+ System.out.println(\"one\")\n+\n+ val i = 0\n+ }\n+\n+ @Test\n+ @WaitApiTest\n+ fun waitTestOne() {\n+ System.out.println(\"wait one\")\n+ throw RuntimeException(\"Test fail 11111\")\n+ }\n+\n+ @Test\n+ @WaitApiTest\n+ fun waitTes3() {\n+ System.out.println(\"3\")\n+ //throw RuntimeException(\"Test fail 11111\")\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/TestNetworkAppComponent.kt",
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/TestNetworkAppComponent.kt",
"diff": "@@ -17,4 +17,5 @@ import ru.surfstudio.standard.app_injector.network.cache.CacheModule\nCacheModule::class])\ninterface TestNetworkAppComponent {\nfun inject(test: BaseNetworkDaggerTest)\n+ fun inject(test: SampleApiTest)\n}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/WaitApiTest.java",
"diff": "+package ru.surfstudio.standard.util;\n+\n+import java.lang.annotation.ElementType;\n+import java.lang.annotation.Retention;\n+import java.lang.annotation.RetentionPolicy;\n+import java.lang.annotation.Target;\n+\n+@Retention(RetentionPolicy.RUNTIME)\n+@Target({ElementType.METHOD})\n+public @interface WaitApiTest {\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/WaitApiTestPassExceprtion.kt",
"diff": "+package ru.surfstudio.standard.util\n+\n+import java.lang.RuntimeException\n+\n+class WaitApiTestPassExceprtion : RuntimeException(\n+ \"Test with annotation @WaitApiTest is finished without exception. \" +\n+ \"If api method is working now, change annotation to @CheckApiTest\")\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | add ApiTestRunner |
652,323 | 11.01.2019 19:40:37 | -10,800 | 49aefbf476b54d9bb25436460aaafcaba480c41f | remove CheckApiTest Annotation | [
{
"change_type": "MODIFY",
"old_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/ApiTestRunner.kt",
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/ApiTestRunner.kt",
"diff": "@@ -14,7 +14,7 @@ class ApiTestRunner(testClass: Class<*>?) : RobolectricTestRunner(testClass) {\n}\nprivate var runCheckApiTests: Boolean = false\n- private var runWaitApiTest: Boolean = false\n+ private var runWaitApiTests: Boolean = false\noverride fun methodBlock(method: FrameworkMethod): Statement {\n@@ -26,7 +26,7 @@ class ApiTestRunner(testClass: Class<*>?) : RobolectricTestRunner(testClass) {\ntry {\ndefaultInvoker.evaluate()\n} catch (e: Throwable) {\n- System.err.println(\"Error occurred, when test with annotation @WaitApiTest is executing. It's normal.\")\n+ System.err.println(\"Error occurred when test with annotation @WaitApiTest is executing. It's normal.\")\ne.printStackTrace()\nfailed = true\n}\n@@ -42,15 +42,19 @@ class ApiTestRunner(testClass: Class<*>?) : RobolectricTestRunner(testClass) {\noverride fun computeTestMethods(): MutableList<FrameworkMethod> {\nextractInputParameters()\n- checkStandardTestMethods()\nval methods = mutableListOf<FrameworkMethod>()\nif (runCheckApiTests) {\n- methods.addAll(testClass.getAnnotatedMethods(CheckApiTest::class.java))\n+ methods.addAll(testClass.getAnnotatedMethods(Test::class.java)\n+ .asSequence()\n+ .filter { !isMethodWithAnnotation(it, WaitApiTest::class.java) }\n+ .toList())\n}\n- if (runWaitApiTest) {\n- methods.addAll(testClass.getAnnotatedMethods(WaitApiTest::class.java))\n+ if (runWaitApiTests) {\n+ val waitApiMethods = testClass.getAnnotatedMethods(WaitApiTest::class.java)\n+ checkMethodsContainsStandardTestAnnotation(waitApiMethods)\n+ methods.addAll(waitApiMethods)\n}\n- checkMethodsContainsStandardTestAnnotation(methods)\n+\nreturn methods\n}\n@@ -58,29 +62,18 @@ class ApiTestRunner(testClass: Class<*>?) : RobolectricTestRunner(testClass) {\nval badMethods = methods.asSequence().filter { !isMethodWithAnnotation(it, Test::class.java) }.toList()\nif (badMethods.isNotEmpty()) {\nval badMethodsStr = badMethods.asSequence().map { it.name }.reduce { left, right -> \"$left, $right\" }\n- throw RuntimeException(\"Api test methods must have @test annotation. Wrong methods: $badMethodsStr\")\n+ throw RuntimeException(\"Api test methods must have @Test annotation. Wrong methods: $badMethodsStr\")\n}\n}\nprivate fun extractInputParameters() {\nrunCheckApiTests = System.getProperty(CHECK_API_TESTS_CONSOLE_PARAMETER) != null\n- runWaitApiTest = System.getProperty(WAIT_API_TESTS_CONSOLE_PARAMETER) != null\n- if (!runCheckApiTests && !runWaitApiTest) {\n+ runWaitApiTests = System.getProperty(WAIT_API_TESTS_CONSOLE_PARAMETER) != null\n+ if (!runCheckApiTests && !runWaitApiTests) {\n//run all when not configured via parameter\nrunCheckApiTests = true\n- runWaitApiTest = true\n- }\n- }\n-\n- private fun checkStandardTestMethods() {\n- val methods = testClass.getAnnotatedMethods(Test::class.java)\n- methods.forEach {\n- if (!isMethodWithAnnotation(it, WaitApiTest::class.java) &&\n- !isMethodWithAnnotation(it, CheckApiTest::class.java)) {\n- throw RuntimeException(\"Api Test class cannot contains test method without \" +\n- \"@WaitApiTest and @CheckApiTest annotations, wrong method: \" + it.name)\n- }\n+ runWaitApiTests = true\n}\n}\n"
},
{
"change_type": "DELETE",
"old_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/CheckApiTest.java",
"new_path": null,
"diff": "-package ru.surfstudio.standard.util;\n-\n-import org.junit.Test;\n-\n-import java.lang.annotation.ElementType;\n-import java.lang.annotation.Retention;\n-import java.lang.annotation.RetentionPolicy;\n-import java.lang.annotation.Target;\n-\n-import ru.surfstudio.android.core.ui.HasName;\n-\n-@Retention(RetentionPolicy.RUNTIME)\n-@Target({ElementType.METHOD})\n-public @interface CheckApiTest {\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/SampleApiTest.kt",
"new_path": "template/app-injector/src/test/java/ru/surfstudio/standard/util/SampleApiTest.kt",
"diff": "@@ -16,7 +16,6 @@ class SampleApiTest : BaseNetworkDaggerTest() {\n}\n@Test\n- @CheckApiTest\nfun testOne() {\nSystem.out.println(\"one\")\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | remove CheckApiTest Annotation |
652,312 | 13.01.2019 21:49:57 | -10,800 | 35ec881bfbcce5f4ff7f173bd6616e9cb0bf8b8c | set testBuildType to debug | [
{
"change_type": "MODIFY",
"old_path": "androidModule.gradle",
"new_path": "androidModule.gradle",
"diff": "@@ -5,8 +5,6 @@ apply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\napply plugin: 'kotlin-kapt'\n-apply from: '../sample-keystore/signingConfigs.gradle'\n-\nandroid {\ncompileSdkVersion project.ext.compileSdkVersion\nbuildToolsVersion project.ext.buildToolsVersion\n@@ -16,7 +14,7 @@ android {\ntargetSdkVersion project.ext.targetSdkVersion\nversionCode project.ext.moduleVersionCode\nversionName project.ext.moduleVersionName\n- testBuildType \"release\"\n+ testBuildType \"debug\"\ntestInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n}\n@@ -38,7 +36,6 @@ android {\nrelease {\nminifyEnabled false\n- signingConfig signingConfigs.release\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "androidSample.gradle",
"new_path": "androidSample.gradle",
"diff": "@@ -4,7 +4,6 @@ apply plugin: 'kotlin-android'\napply plugin: 'kotlin-android-extensions'\napply plugin: 'kotlin-kapt'\n-apply from: '../sample-keystore/signingConfigs.gradle'\napply from: '../androidTestModule.gradle'\nandroid {\n@@ -28,15 +27,6 @@ android {\ncheckReleaseBuilds false\nabortOnError false\n}\n-\n- buildTypes {\n- debug {\n-\n- }\n- release {\n- signingConfig signingConfigs.release\n- }\n- }\n}\ndependencies {\n"
},
{
"change_type": "MODIFY",
"old_path": "androidTestModule.gradle",
"new_path": "androidTestModule.gradle",
"diff": "android {\ndefaultConfig {\n- testBuildType \"release\"\n+ testBuildType \"debug\"\ntestInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"new_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"diff": "@@ -10,7 +10,7 @@ pipeline.init()\npipeline.getStage(pipeline.INSTRUMENTATION_TEST).strategy = StageStrategy.SKIP_STAGE\npipeline.getStage(pipeline.STATIC_CODE_ANALYSIS).strategy = StageStrategy.SKIP_STAGE\npipeline.buildGradleTask = \"clean assemble\"\n-pipeline.androidTestBuildType = \"release\"\n+pipeline.androidTestBuildType = \"debug\"\n//run\npipeline.run()\n"
},
{
"change_type": "MODIFY",
"old_path": "config.gradle",
"new_path": "config.gradle",
"diff": "@@ -19,7 +19,7 @@ ext {\ncrashlyticsVersion = '2.9.6' //http://bit.ly/2v5mXbp\n//lang\n- kotlinVersion = '1.3.10' //https://goo.gl/2Epeje\n+ kotlinVersion = '1.3.11' //https://goo.gl/2Epeje\nankoVersion = '0.10.8' //https://goo.gl/XGJGR7\nannimonStreamVersion = '1.2.1' //https://bit.ly/2Ke0nlQ\njetbrainsAnnotationsVersion = '16.0.3' //http://bit.ly/2NYf6Dt\n"
},
{
"change_type": "MODIFY",
"old_path": "template/app-injector/build.gradle",
"new_path": "template/app-injector/build.gradle",
"diff": "@@ -31,7 +31,7 @@ android {\nsetProperty(\"archivesBaseName\", \"$applicationName-$versionName-($versionCode)\")\n- testBuildType 'release' //todo replace to 'qa' for real app\n+ testBuildType 'debug' //todo replace to 'qa' for real app\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "template/config.gradle",
"new_path": "template/config.gradle",
"diff": "@@ -18,7 +18,7 @@ ext {\ncrashlyticsVersion = '2.9.6' //http://bit.ly/2v5mXbp\n//lang\n- kotlinVersion = '1.3.10' //https://goo.gl/2Epeje\n+ kotlinVersion = '1.3.11' //https://goo.gl/2Epeje\nankoVersion = '0.10.8' //https://goo.gl/XGJGR7\nannimonStreamVersion = '1.2.1' //https://bit.ly/2Ke0nlQ\njetbrainsAnnotationsVersion = '16.0.3' //http://bit.ly/2NYf6Dt\n"
},
{
"change_type": "DELETE",
"old_path": "template/proguard-test-rules.pro",
"new_path": null,
"diff": "-# Add project specific ProGuard rules here.\n-# You can control the set of applied configuration files using the\n-# proguardFiles setting in build.gradle.\n-#\n-# For more details, see\n-# http://developer.android.com/guide/developing/tools/proguard.html\n-\n-# If your project uses WebView with JS, uncomment the following\n-# and specify the fully qualified class name to the JavaScript interface\n-# class:\n-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n-# public *;\n-#}\n-\n-# Uncomment this to preserve the line number information for\n-# debugging stack traces.\n-#-keepattributes SourceFile,LineNumberTable\n-\n-# If you keep the line number information, uncomment this to\n-# hide the original source file name.\n-#-renamesourcefileattribute SourceFile\n-\n--dontwarn androidx.espresso.**\n--dontwarn org.xmlpull.v1.**\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-387 set testBuildType to debug |
652,312 | 13.01.2019 22:01:11 | -10,800 | 63d4022235624f4c1ae04c7d3e5e606566ecec38 | change test build type to debug | [
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfileDeployJob.groovy",
"new_path": "ci-internal/JenkinsfileDeployJob.groovy",
"diff": "@@ -146,7 +146,7 @@ pipeline.stages = [\n}\n},\npipeline.createStage(BUILD, StageStrategy.FAIL_WHEN_STAGE_ERROR){\n- AndroidPipelineHelper.buildStageBodyAndroid(script, \"clean assembleRelease\")\n+ AndroidPipelineHelper.buildStageBodyAndroid(script, \"clean assembleRelease assembleDebug\")\n},\npipeline.createStage(UNIT_TEST, StageStrategy.FAIL_WHEN_STAGE_ERROR){\nAndroidPipelineHelper.unitTestStageBodyAndroid(script,\n@@ -158,7 +158,7 @@ pipeline.stages = [\nAndroidPipelineHelper.instrumentationTestStageBodyAndroid(\nscript,\nnew AvdConfig(),\n- \"release\",\n+ \"debug\",\ngetTestInstrumentationRunnerName,\nnew AndroidTestConfig(\n\"assembleAndroidTest\",\n"
},
{
"change_type": "MODIFY",
"old_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"new_path": "ci-internal/JenkinsfilePullRequestJob.groovy",
"diff": "@@ -9,8 +9,8 @@ pipeline.init()\n//customization\npipeline.node = \"android-2\"\npipeline.getStage(pipeline.STATIC_CODE_ANALYSIS).strategy = StageStrategy.SKIP_STAGE\n-pipeline.buildGradleTask = \"clean assembleRelease\"\n-pipeline.androidTestBuildType = \"release\"\n+pipeline.buildGradleTask = \"clean assembleRelease assembleDebug\"\n+pipeline.androidTestBuildType = \"debug\"\n//run\npipeline.run()\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | change test build type to debug |
652,337 | 16.01.2019 15:07:42 | -18,000 | b0b11d56492e625ed1b4e1a293cf716eb35b1f78 | Added request delay settings | [
{
"change_type": "MODIFY",
"old_path": "shared-pref/src/main/java/ru/surfstudio/android/shared/pref/SettingsUtil.kt",
"new_path": "shared-pref/src/main/java/ru/surfstudio/android/shared/pref/SettingsUtil.kt",
"diff": "@@ -103,6 +103,10 @@ object SettingsUtil {\nreturn sp.getLong(key, EMPTY_LONG_SETTING)\n}\n+ fun getLong(sp: SharedPreferences, key: String, defaultValue: Long): Long {\n+ return sp.getLong(key, defaultValue)\n+ }\n+\nfun putBoolean(sp: SharedPreferences, key: String, value: Boolean) {\nval editor = sp.edit()\neditor.putBoolean(key, value)\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/common_widgets/TitleSubtitleSwitch.kt",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/common_widgets/TitleSubtitleSwitch.kt",
"diff": "@@ -58,10 +58,10 @@ class TitleSubtitleSwitch(context: Context, attrs: AttributeSet) : ConstraintLay\ntypedArray.recycle()\n}\n- fun setOnCheckedChangeListener(listener: ((CompoundButton, Boolean) -> Unit)) {\n- value_switch.setOnCheckedChangeListener { buttonView, isChecked ->\n- onCheckedChangeListener.onCheckedChanged(buttonView, isChecked)\n- listener(buttonView, isChecked)\n+ fun setOnCheckedChangeListener(listener: (CompoundButton, Boolean) -> Unit) {\n+ value_switch.setOnClickListener {\n+ onCheckedChangeListener.onCheckedChanged(value_switch, value_switch.isChecked)\n+ listener(value_switch, isChecked)\n}\n}\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/server_settings/ServerSettingsDebugActivityView.kt",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/server_settings/ServerSettingsDebugActivityView.kt",
"diff": "package ru.surfstudio.standard.f_debug.server_settings\n+import android.os.Bundle\n+import android.os.PersistableBundle\n+import com.jakewharton.rxbinding2.widget.RxProgressBar\n+import com.jakewharton.rxbinding2.widget.RxSeekBar\nimport kotlinx.android.synthetic.main.activity_server_settings_debug.*\nimport ru.surfstudio.android.core.mvp.activity.BaseRenderableActivityView\nimport ru.surfstudio.android.template.f_debug.R\n@@ -26,15 +30,22 @@ class ServerSettingsDebugActivityView : BaseRenderableActivityView<ServerSetting\noverride fun renderInternal(sm: ServerSettingsDebugScreenModel) {\nserver_settings_chuck_switch.setChecked(sm.isChuckEnabled)\nserver_settings_test_server_switch.setChecked(sm.isTestServerEnabled)\n- addCheckedChangeListener()\n+ server_settings_request_delay_tv.text = getString(R.string.server_settings_request_delay_text, sm.requestDelaySeconds)\n+ server_settings_request_delay_seek_bar.progress = sm.requestDelayCoefficient\n}\n- private fun addCheckedChangeListener() {\n- server_settings_chuck_switch.setOnCheckedChangeListener { _, _ ->\n- presenter.setChuckEnabled(server_settings_chuck_switch.isChecked())\n+ override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?, viewRecreated: Boolean) {\n+ super.onCreate(savedInstanceState, persistentState, viewRecreated)\n+ initListeners()\n+ }\n+\n+ private fun initListeners() {\n+ server_settings_chuck_switch.setOnCheckedChangeListener { _, isEnabled ->\n+ presenter.setChuckEnabled(isEnabled)\n}\nserver_settings_test_server_switch.setOnCheckedChangeListener { _, isEnabled ->\npresenter.setTestServerEnabled(isEnabled)\n}\n+ presenter.requestDelayCoefficientChanges(RxSeekBar.userChanges(server_settings_request_delay_seek_bar).skipInitialValue())\n}\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/storage/DebugServerSettingsStorage.kt",
"new_path": "template/f-debug/src/main/java/ru/surfstudio/standard/f_debug/storage/DebugServerSettingsStorage.kt",
"diff": "@@ -8,6 +8,7 @@ import javax.inject.Inject\nimport javax.inject.Named\nprivate const val IS_CHUCK_ENABLED_KEY = \"IS_CHUCK_ENABLED_KEY\"\nprivate const val IS_TEST_SERVER_ENABLED = \"IS_TEST_SERVER_ENABLED\"\n+private const val REQUEST_DELAY = \"REQUEST_DELAY\"\n@PerApplication\nclass DebugServerSettingsStorage @Inject constructor(\n@Named(NO_BACKUP_SHARED_PREF) private val noBackupSharedPref: SharedPreferences\n@@ -20,4 +21,8 @@ class DebugServerSettingsStorage @Inject constructor(\nvar isTestServerEnabled: Boolean\nget() = SettingsUtil.getBoolean(noBackupSharedPref, IS_TEST_SERVER_ENABLED, true)\nset(value) = SettingsUtil.putBoolean(noBackupSharedPref, IS_TEST_SERVER_ENABLED, value)\n+\n+ var requestDelay: Long\n+ get() = SettingsUtil.getLong(noBackupSharedPref, REQUEST_DELAY, 0L)\n+ set(value) = SettingsUtil.putLong(noBackupSharedPref, REQUEST_DELAY, value)\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/f-debug/src/main/res/layout/activity_server_settings_debug.xml",
"new_path": "template/f-debug/src/main/res/layout/activity_server_settings_debug.xml",
"diff": "android:layout_marginTop=\"16dp\"\napp:switch_subtitle=\"@string/server_url_subtitle_text\"\napp:switch_title=\"@string/server_url_title_text\" />\n+\n+ <TextView\n+ android:id=\"@+id/server_settings_request_delay_tv\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ android:layout_marginStart=\"16dp\"\n+ android:layout_marginTop=\"16dp\"\n+ android:layout_marginEnd=\"16dp\"\n+ android:textSize=\"20sp\" />\n+\n+ <SeekBar\n+ android:id=\"@+id/server_settings_request_delay_seek_bar\"\n+ android:layout_width=\"match_parent\"\n+ android:layout_height=\"wrap_content\"\n+ android:max=\"5\"\n+ android:padding=\"16dp\"\n+ android:progress=\"0\" />\n</LinearLayout>\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-386 Added request delay settings |
652,337 | 16.01.2019 17:06:01 | -18,000 | 1d84834e0f2785e595fd2de67e82f1251277f441 | added gradle scan plugin | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -17,6 +17,7 @@ buildscript {\njcenter()\nmaven { url 'https://maven.fabric.io/public' }\nmaven { url 'https://maven.google.com' }\n+ maven { url 'https://plugins.gradle.org/m2/' }\n}\ndependencies {\n@@ -24,5 +25,14 @@ buildscript {\nclasspath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\nclasspath \"com.google.gms:google-services:$googleServicesVersion\"\nclasspath \"io.fabric.tools:gradle:$fabricVersion\"\n+ classpath \"com.gradle:build-scan-plugin:$buildScanPluginVersion\"\n}\n}\n+\n+apply plugin: \"com.gradle.build-scan\"\n+\n+buildScan {\n+ termsOfServiceUrl = 'https://gradle.com/terms-of-service'\n+ termsOfServiceAgree = 'yes'\n+ allowUntrustedServer = true\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "config.gradle",
"new_path": "config.gradle",
"diff": "@@ -14,6 +14,7 @@ ext {\ngradlePluginVersion = '3.2.1' //https://bit.ly/2NXD4Pe\nbuildToolsVersion = \"28.0.3\" //https://bit.ly/2DNmq3Y\ngoogleServicesVersion = '4.2.0' //https://bit.ly/2Q5FCge\n+ buildScanPluginVersion = '1.16' //https://goo.gl/coZHFo\nfabricVersion = \"1.26.1\" //https://bit.ly/2OOly00\ncrashlyticsVersion = '2.9.6' //http://bit.ly/2v5mXbp\n"
},
{
"change_type": "MODIFY",
"old_path": "template/build.gradle",
"new_path": "template/build.gradle",
"diff": "@@ -5,6 +5,7 @@ buildscript {\ngoogle()\njcenter()\nmaven { url 'https://maven.fabric.io/public' }\n+ maven { url 'https://plugins.gradle.org/m2/' }\n}\ndependencies {\n@@ -13,6 +14,7 @@ buildscript {\nclasspath \"com.google.gms:google-services:$googleServicesVersion\"\nclasspath \"io.fabric.tools:gradle:$fabricVersion\"\nclasspath \"com.akaita.android:easylauncher:$easyLauncherVersion\"\n+ classpath \"com.gradle:build-scan-plugin:$buildScanPluginVersion\"\n}\n}\n@@ -30,3 +32,9 @@ allprojects {\ntask clean(type: Delete) {\ndelete rootProject.buildDir\n}\n+\n+buildScan {\n+ termsOfServiceUrl = 'https://gradle.com/terms-of-service'\n+ termsOfServiceAgree = 'yes'\n+ allowUntrustedServer = true\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "template/config.gradle",
"new_path": "template/config.gradle",
"diff": "@@ -13,6 +13,7 @@ ext {\ngradlePluginVersion = '3.2.1' //https://bit.ly/2NXD4Pe\nbuildToolsVersion = \"28.0.3\" //https://bit.ly/2DNmq3Y\ngoogleServicesVersion = '4.2.0' //https://bit.ly/2Q5FCge\n+ buildScanPluginVersion = '1.16' //https://goo.gl/coZHFo\nfabricVersion = \"1.26.1\" //https://bit.ly/2OOly00\ncrashlyticsVersion = '2.9.6' //http://bit.ly/2v5mXbp\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-385 added gradle scan plugin |
652,299 | 18.01.2019 17:20:08 | -10,800 | be8bbec8b8cf0d92abe1dde79111c9e4b9f52262 | Cross-feature routes implementation | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/BundleIntentRoute.java",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation;\n+\n+/**\n+ * Navigation route interface with prepared Intent and Bundle.\n+ * <br><br>\n+ * See: {@link Route}.\n+ * <br><br>\n+ */\n+public interface BundleIntentRoute extends IntentRoute, BundleRoute {\n+ //empty\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/BundleRoute.java",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation;\n+\n+import android.os.Bundle;\n+\n+/**\n+ * Navigation route interface with prepared Bundle.\n+ * <br><br>\n+ * See: {@link Route}.\n+ * <br><br>\n+ */\n+public interface BundleRoute extends Route {\n+\n+ /**\n+ * Prepared Bundle for passing data to the target Fragment.\n+ * Also used for passing shared-element view data to the following Activity in case of\n+ * shared-element transition implementation.\n+ *\n+ * @return prepared Bundle\n+ */\n+ Bundle prepareBundle();\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/IntentRoute.java",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation;\n+\n+import android.content.Context;\n+import android.content.Intent;\n+\n+/**\n+ * Navigation route interface with prepared Intent.\n+ * <br><br>\n+ * See: {@link Route}.\n+ * <br><br>\n+ */\n+public interface IntentRoute extends Route {\n+\n+ /**\n+ * Prepared Intent for calling the target Activity and passing data.\n+ *\n+ * @param context activity context\n+ * @return prepared Intent\n+ */\n+ Intent prepareIntent(Context context);\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/ActivityWithParamsRoute.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/ActivityWithParamsRoute.java",
"diff": "*/\npackage ru.surfstudio.android.core.ui.navigation.activity.route;\n-\nimport android.content.Intent;\n/**\n@@ -30,5 +29,4 @@ public abstract class ActivityWithParamsRoute extends ActivityRoute {\n}\n-\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/ActivityWithResultRoute.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/ActivityWithResultRoute.java",
"diff": "*/\npackage ru.surfstudio.android.core.ui.navigation.activity.route;\n-\nimport android.content.Intent;\nimport java.io.Serializable;\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/cross_feature/ActivityCrossFeatureRoute.kt",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation.activity.route.cross_feature\n+\n+import android.content.Context\n+import android.content.Intent\n+import android.os.Bundle\n+import ru.surfstudio.android.core.ui.navigation.activity.route.ActivityRoute\n+import ru.surfstudio.android.logger.Logger\n+\n+/**\n+ * Cross-feature navigation activity route between two activities in different independent\n+ * Gradle-projects.\n+ *\n+ * @see [ActivityRoute]\n+ * @see [CrossFeatureRoute]\n+ */\n+abstract class ActivityCrossFeatureRoute :\n+ ActivityRoute(),\n+ CrossFeatureRoute {\n+\n+ override fun prepareIntent(context: Context): Intent? {\n+ try {\n+ return Intent(context, Class.forName(targetClassPath()))\n+ } catch (e: ClassNotFoundException) {\n+ Logger.e(\"Activity with the following classpath was not found in the current \" +\n+ \"project: ${targetClassPath()}\")\n+ }\n+ return null\n+ }\n+\n+ override fun prepareBundle(): Bundle? {\n+ return null\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/cross_feature/ActivityCrossFeatureWithParamsAndResultRoute.kt",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation.activity.route.cross_feature\n+\n+import android.content.Intent\n+import ru.surfstudio.android.core.ui.navigation.activity.route.ActivityRoute\n+import java.io.Serializable\n+\n+/**\n+ * Cross-feature navigation activity route with support of activity result delivering and parameters.\n+ *\n+ * Designed for navigation between two activities in different independent Gradle-projects.\n+\n+ * @param T result type (should be [Serializable])\n+ *\n+ * @see [ActivityRoute]\n+ * @see [CrossFeatureRoute]\n+ * @see [ActivityCrossFeatureRoute]\n+ */\n+abstract class ActivityCrossFeatureWithParamsAndResultRoute<T : Serializable> :\n+ ActivityCrossFeatureWithResultRoute<T> {\n+\n+ @Suppress(\"ConvertSecondaryConstructorToPrimary\", \"unused\")\n+ constructor(intent: Intent) {\n+ //empty\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/cross_feature/ActivityCrossFeatureWithParamsRoute.kt",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation.activity.route.cross_feature\n+\n+import android.content.Intent\n+import ru.surfstudio.android.core.ui.navigation.activity.route.ActivityRoute\n+\n+/**\n+ * Cross-feature navigation activity route with parameters.\n+ *\n+ * Designed for navigation between two activities in different independent Gradle-projects.\n+ *\n+ * @see [ActivityRoute]\n+ * @see [CrossFeatureRoute]\n+ * @see [ActivityCrossFeatureRoute]\n+ */\n+abstract class ActivityCrossFeatureWithParamsRoute : ActivityCrossFeatureRoute {\n+\n+ @Suppress(\"unused\", \"ConvertSecondaryConstructorToPrimary\")\n+ constructor(intent: Intent) {\n+ //empty\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/cross_feature/ActivityCrossFeatureWithResultRoute.kt",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation.activity.route.cross_feature\n+\n+import android.content.Intent\n+import ru.surfstudio.android.core.ui.event.result.SupportOnActivityResultRoute\n+import ru.surfstudio.android.core.ui.navigation.activity.route.ActivityRoute\n+import java.io.Serializable\n+\n+/**\n+ * Cross-feature navigation activity route with support of activity result delivering.\n+ *\n+ * Designed for navigation between two activities in different independent Gradle-projects.\n+\n+ * @param T result type (should be [Serializable])\n+ *\n+ * @see [ActivityRoute]\n+ * @see [CrossFeatureRoute]\n+ * @see [ActivityCrossFeatureRoute]\n+ */\n+abstract class ActivityCrossFeatureWithResultRoute<T : Serializable> :\n+ ActivityCrossFeatureRoute(),\n+ SupportOnActivityResultRoute<T> {\n+\n+ override fun prepareResultIntent(resultData: T): Intent {\n+ val i = Intent()\n+ i.putExtra(SupportOnActivityResultRoute.EXTRA_RESULT, resultData)\n+ return i\n+ }\n+\n+ override fun parseResultIntent(resultIntent: Intent): T {\n+ return resultIntent.getSerializableExtra(SupportOnActivityResultRoute.EXTRA_RESULT) as T\n+ }\n+\n+ override fun getRequestCode(): Int {\n+ return Math.abs(this.javaClass.canonicalName!!.hashCode() % MAX_REQUEST_CODE)\n+ }\n+\n+}\n+\n+private const val MAX_REQUEST_CODE = 32768\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/route/cross_feature/CrossFeatureRoute.kt",
"diff": "+/*\n+ Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n+ */\n+package ru.surfstudio.android.core.ui.navigation.activity.route.cross_feature\n+\n+/**\n+ * Interface for cross-feature navigation route.\n+ *\n+ * Should be used for routing between two activities from different independent Gradle-projects.\n+ *\n+ * For using it just override [targetClassPath] method and return full classpath of the target\n+ * feature starting point (e.g. activity).\n+ */\n+interface CrossFeatureRoute {\n+\n+ /**\n+ * @return target starting point full classpath (e.g. \"com.name.app.feature.ActivityName\")\n+ */\n+ fun targetClassPath(): String\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mvp-dialog/src/main/java/ru/surfstudio/android/mvp/dialog/navigation/route/DialogWithParamsRoute.java",
"new_path": "mvp-dialog/src/main/java/ru/surfstudio/android/mvp/dialog/navigation/route/DialogWithParamsRoute.java",
"diff": "@@ -26,7 +26,7 @@ public abstract class DialogWithParamsRoute extends DialogRoute {\n@Override\nprotected abstract Class<? extends DialogFragment> getFragmentClass();\n- protected abstract Bundle prepareBundle();\n+ public abstract Bundle prepareBundle();\n@Override\npublic DialogFragment createFragment() {\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-397 Cross-feature routes implementation |
652,299 | 21.01.2019 17:01:26 | -10,800 | bf899ab75ab11c6ac37eb82d9cf37b4c0bcb8970 | Routes interfaces improvements. | [
{
"change_type": "RENAME",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/IntentRoute.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/ActivityRouteInterface.java",
"diff": "@@ -17,14 +17,19 @@ package ru.surfstudio.android.core.ui.navigation;\nimport android.content.Context;\nimport android.content.Intent;\n+import android.os.Bundle;\n+\n+import androidx.core.app.ActivityOptionsCompat;\n/**\n- * Navigation route interface with prepared Intent.\n+ * Navigation route interface with prepared Intent and {@link androidx.core.app.ActivityOptionsCompat}.\n+ *\n+ * Used for navigation between activities.\n* <br><br>\n* See: {@link Route}.\n* <br><br>\n*/\n-public interface IntentRoute extends Route {\n+public interface ActivityRouteInterface {\n/**\n* Prepared Intent for calling the target Activity and passing data.\n@@ -33,4 +38,22 @@ public interface IntentRoute extends Route {\n* @return prepared Intent\n*/\nIntent prepareIntent(Context context);\n+\n+ /**\n+ * Prepared {@link ActivityOptionsCompat} for setting up Activity transitions properties.\n+ *\n+ * @return prepared ActivityOptionsCompat\n+ */\n+ ActivityOptionsCompat prepareActivityOptionsCompat();\n+\n+ /**\n+ * Prepared Bundle for passing data to the target Fragment.\n+ * Also used for passing shared-element view data to the following Activity in case of\n+ * shared-element transition implementation.\n+ *\n+ * @return prepared Bundle\n+ * @deprecated use {@link ActivityRouteInterface#prepareActivityOptionsCompat()} instead\n+ */\n+ @Deprecated\n+ Bundle prepareBundle();\n}\n\\ No newline at end of file\n"
},
{
"change_type": "DELETE",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/BundleIntentRoute.java",
"new_path": null,
"diff": "-/*\n- Copyright (c) 2018-present, SurfStudio LLC, Maxim Tuev.\n-\n- Licensed under the Apache License, Version 2.0 (the \"License\");\n- you may not use this file except in compliance with the License.\n- You may obtain a copy of the License at\n-\n- http://www.apache.org/licenses/LICENSE-2.0\n-\n- Unless required by applicable law or agreed to in writing, software\n- distributed under the License is distributed on an \"AS IS\" BASIS,\n- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n- See the License for the specific language governing permissions and\n- limitations under the License.\n- */\n-package ru.surfstudio.android.core.ui.navigation;\n-\n-/**\n- * Navigation route interface with prepared Intent and Bundle.\n- * <br><br>\n- * See: {@link Route}.\n- * <br><br>\n- */\n-public interface BundleIntentRoute extends IntentRoute, BundleRoute {\n- //empty\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "RENAME",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/BundleRoute.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/FragmentRouteInterface.java",
"diff": "@@ -19,11 +19,12 @@ import android.os.Bundle;\n/**\n* Navigation route interface with prepared Bundle.\n+ * Used for navigation between fragments.\n* <br><br>\n* See: {@link Route}.\n* <br><br>\n*/\n-public interface BundleRoute extends Route {\n+public interface FragmentRouteInterface extends Route {\n/**\n* Prepared Bundle for passing data to the target Fragment.\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/Route.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/Route.java",
"diff": "@@ -36,7 +36,7 @@ package ru.surfstudio.android.core.ui.navigation;\n* Route is able to pass up to 10 data items marked with one of the built-in \"EXTRA_NUMBERED\"\n* string markers.\n* <br><br>\n- * (see: {@link IntentRoute}, {@link BundleRoute}, {@link BundleIntentRoute})\n+ * (see: {@link ActivityRouteInterface}, {@link FragmentRouteInterface})\n*/\npublic interface Route {\nString EXTRA_FIRST = \"EXTRA_FIRST\";\n"
},
{
"change_type": "MODIFY",
"old_path": "shared-pref-sample/src/main/java/ru/surfstudio/android/shared/pref/sample/ui/screen/main/MainActivityRoute.kt",
"new_path": "shared-pref-sample/src/main/java/ru/surfstudio/android/shared/pref/sample/ui/screen/main/MainActivityRoute.kt",
"diff": "@@ -2,6 +2,7 @@ package ru.surfstudio.android.shared.pref.sample.ui.screen.main\nimport android.content.Context\nimport android.content.Intent\n+import android.os.Bundle\nimport ru.surfstudio.android.core.ui.navigation.activity.route.ActivityRoute\n/**\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-397 Routes interfaces improvements. |
652,299 | 21.01.2019 18:11:18 | -10,800 | 569fbf33208b02b5e4ce988dd6aceac2ac9f077f | Split install features support dependencies | [
{
"change_type": "MODIFY",
"old_path": "config.gradle",
"new_path": "config.gradle",
"diff": "@@ -40,6 +40,7 @@ ext {\nandroidxMediaVersion = '1.0.0' //http://bit.ly/2RclLfy\nandroidxLegacySupportVersion = '1.0.0' //http://bit.ly/2Qm31gi\nandroidxMultidexVersion = '2.0.0' //http://bit.ly/2r6uX9G\n+ playCoreVersion = '1.3.6' //http://bit.ly/2Hod1T1\n//gms\nfirebaseCoreVersion = '16.0.5' //http://bit.ly/2Q81pGJ\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/build.gradle",
"new_path": "core-ui/build.gradle",
"diff": "@@ -3,6 +3,7 @@ apply from: '../androidModule.gradle'\ndependencies {\napi \"com.google.android.material:material:$androidxMaterialVersion\"\nimplementation \"androidx.appcompat:appcompat:$androidxVersion\"\n+ implementation \"com.google.android.play:core:$playCoreVersion\" //for split install features support\nimplementation \"androidx.annotation:annotation:$androidxAnnotationVersion\"\nimplementation \"com.annimon:stream:$annimonStreamVersion\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/ActivityRouteInterface.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/ActivityRouteInterface.java",
"diff": "@@ -29,7 +29,7 @@ import androidx.core.app.ActivityOptionsCompat;\n* See: {@link Route}.\n* <br><br>\n*/\n-public interface ActivityRouteInterface {\n+public interface ActivityRouteInterface extends Route {\n/**\n* Prepared Intent for calling the target Activity and passing data.\n"
},
{
"change_type": "MODIFY",
"old_path": "template/config.gradle",
"new_path": "template/config.gradle",
"diff": "@@ -30,6 +30,7 @@ ext {\n//androidx\nandroidxVersion = '1.0.2' //http://bit.ly/2zjueqh\nandroidxMultidexVersion = '2.0.0' //http://bit.ly/2r6uX9G\n+ playCoreVersion = '1.3.6' //http://bit.ly/2Hod1T1\n//gms\nfirebaseCoreVersion = '16.0.5' //http://bit.ly/2Q81pGJ\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-397 Split install features support dependencies |
652,304 | 24.01.2019 03:58:26 | -10,800 | 7c06ba5ac6733c1743631ba33f389e5263d171d5 | Single, Maybe, Completable | [
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainPresenter.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainPresenter.kt",
"diff": "@@ -36,10 +36,10 @@ class MainPresenter @Inject constructor(\noverride fun onFirstLoad() {\nsuper.onFirstLoad()\n- pm.incAction.bindTo(pm.counterState) { 100 }\n- pm.decAction.bindTo(pm.counterState) { 20 }\n+ pm.incAction.getObservable().map { 100 } bindTo pm.counterState\n+ pm.decAction.getObservable().map { 20 } bindTo pm.counterState\n+ pm.doubleTextAction.getObservable().map { pm.textEditState.let { it.value + it.value } } bindTo pm.textEditState\npm.textEditState bindTo pm.sampleCommand\n- pm.doubleTextAction.bindTo(pm.textEditState) { pm.textEditState.let { it.value + it.value } }\npm.checkboxSampleActivityOpen bindTo { activityNavigator.start(CheckboxActivityRoute()) }\npm.cycledSampleActivityOpen bindTo { activityNavigator.start(CycledActivityRoute()) }\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/domain/Relation.kt",
"new_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/domain/Relation.kt",
"diff": "package ru.surfstudio.android.core.mvp.rx.domain\n+import io.reactivex.Completable\n+import io.reactivex.Maybe\nimport io.reactivex.Observable\nimport io.reactivex.Single\nimport io.reactivex.disposables.Disposable\n@@ -38,6 +40,7 @@ interface Related<S : RelationEntity> {\nfun <T> subscribe(observable: Observable<T>, onNext: Consumer<T>): Disposable\n+\nfun <T> Relation<T, *, S>.getObservable() =\nthis.getObservable(relationEntity())\n@@ -47,17 +50,34 @@ interface Related<S : RelationEntity> {\nfun <T> Relation<T, S, *>.accept(newValue: T) =\nthis.getConsumer().accept(newValue)\n- fun Relation<kotlin.Unit, S, *>.accept() =\n+ fun Relation<Unit, S, *>.accept() =\nthis.getConsumer().accept(Unit)\n+\ninfix fun <T> Observable<T>.bindTo(consumer: Consumer<T>) =\nthis@Related.subscribe(this, consumer)\n+ infix fun <T> Observable<T>.bindTo(relation: Relation<T, S, *>) =\n+ this.bindTo(relation.getConsumer())\n+\ninfix fun <T> Single<T>.bindTo(consumer: Consumer<T>) =\nthis@Related.subscribe(this.toObservable(), consumer)\n- fun <T, R> Observable<T>.bindTo(consumer: Consumer<R>, transformer: (T) -> R) =\n- this@Related.subscribe(this.map { transformer(it) }, consumer)\n+ infix fun <T> Single<T>.bindTo(relation: Relation<T, S, *>) =\n+ this.bindTo(relation.getConsumer())\n+\n+ infix fun <T> Maybe<T>.bindTo(consumer: Consumer<T>) =\n+ this@Related.subscribe(this.toObservable(), consumer)\n+\n+ infix fun <T> Maybe<T>.bindTo(relation: Relation<T, S, *>) =\n+ this.bindTo(relation.getConsumer())\n+\n+ infix fun Completable.bindTo(consumer: Consumer<Unit>) =\n+ this@Related.subscribe(this.toObservable(), consumer)\n+\n+ infix fun Completable.bindTo(relation: Relation<Unit, S, *>) =\n+ this.bindTo(relation.getConsumer())\n+\ninfix fun <T> Observable<T>.bindTo(consumer: (T) -> Unit) =\nthis@Related.subscribe(this, Consumer { consumer(it) })\n@@ -65,6 +85,7 @@ interface Related<S : RelationEntity> {\ninfix fun Observable<Unit>.bindTo(consumer: () -> Unit) =\nthis@Related.subscribe(this, Consumer { consumer() })\n+\ninfix fun <T> Relation<T, *, S>.bindTo(consumer: (T) -> Unit) =\nthis.getObservable()\n.bindTo(consumer)\n@@ -73,17 +94,8 @@ interface Related<S : RelationEntity> {\nthis.getObservable()\n.bindTo(consumer)\n- infix fun <T> Observable<T>.bindTo(relation: Relation<T, S, *>) =\n- this.bindTo(relation.getConsumer())\n-\n- infix fun <T> Single<T>.bindTo(relation: Relation<T, S, *>) =\n- this.bindTo(relation.getConsumer())\n-\ninfix fun <T> Relation<T, *, S>.bindTo(relation: Relation<T, S, *>) =\nthis.getObservable().bindTo(relation.getConsumer())\n-\n- fun <T, R> Relation<T, *, S>.bindTo(relation: Relation<R, S, *>, transformer: (T) -> R) =\n- this.getObservable().bindTo(relation.getConsumer(), transformer)\n}\ninterface RelationEntity\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-227 Single, Maybe, Completable |
652,304 | 24.01.2019 05:09:32 | -10,800 | 91134774856d585ebc06d7f907f38ec4214ffe60 | fun getObservable -> val observable | [
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainActivityView.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainActivityView.kt",
"diff": "@@ -30,7 +30,7 @@ class MainActivityView : BaseRxActivityView<MainModel>() {\noverride fun bind(pm: MainModel) {\n- pm.counterState.getObservable().map { it.toString() } bindTo main_counter_tv::setText\n+ pm.counterState.observable.map { it.toString() } bindTo main_counter_tv::setText\npm.textEditState bindTo main_text_et::setText\npm.sampleCommand bindTo text_tv::setText\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainPresenter.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/MainPresenter.kt",
"diff": "@@ -36,9 +36,9 @@ class MainPresenter @Inject constructor(\noverride fun onFirstLoad() {\nsuper.onFirstLoad()\n- pm.incAction.getObservable().map { 100 } bindTo pm.counterState\n- pm.decAction.getObservable().map { 20 } bindTo pm.counterState\n- pm.doubleTextAction.getObservable().map { pm.textEditState.let { it.value + it.value } } bindTo pm.textEditState\n+ pm.incAction.observable.map { 100 } bindTo pm.counterState\n+ pm.decAction.observable.map { 20 } bindTo pm.counterState\n+ pm.doubleTextAction.observable.map { pm.textEditState.let { it.value + it.value } } bindTo pm.textEditState\npm.textEditState bindTo pm.sampleCommand\npm.checkboxSampleActivityOpen bindTo { activityNavigator.start(CheckboxActivityRoute()) }\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/checkbox/CheckboxPresenter.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/checkbox/CheckboxPresenter.kt",
"diff": "@@ -33,14 +33,14 @@ class CheckboxPresenter @Inject constructor(\nval checkboxesObs =\nObservables.combineLatest(\n- pm.checkAction1.getObservable(),\n- pm.checkAction2.getObservable(),\n- pm.checkAction3.getObservable()\n+ pm.checkAction1.observable,\n+ pm.checkAction2.observable,\n+ pm.checkAction3.observable\n) { b1, b2, b3 -> Triple(b1, b2, b3) }\ncheckboxesObs.map { it.first.toInt() + it.second.toInt() + it.third.toInt() } bindTo pm.count\n- pm.sendAction.getObservable()\n+ pm.sendAction.observable\n.withLatestFrom(checkboxesObs)\n{ _, triple -> \"cb1: ${triple.first}, cb2: ${triple.second}, cb3: ${triple.third}\" }\n.bindTo(pm.messageCommand)\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/cycled/CycledActivityView.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/cycled/CycledActivityView.kt",
"diff": "@@ -44,9 +44,9 @@ class CycledActivityView : BaseRxActivityView<CycledScreenModel>() {\norigin_other_rb.prepare())\nwith(pm) {\n- origin.getObservable().filter { !it.sources.contains(Source.ORIGIN) }.map { it.value } bindTo ::checkRb\n- nomen.getObservable().filter { !it.sources.contains(Source.NOMEN) }.map { it.value as CharSequence } bindTo nomen_et::setText\n- baseOfNomen.getObservable().filter { !it.sources.contains(Source.BASE_OF_NOMEN) }.map { it.value } bindTo nomen_base_et::setText\n+ origin.observable.filter { !it.sources.contains(Source.ORIGIN) }.map { it.value } bindTo ::checkRb\n+ nomen.observable.filter { !it.sources.contains(Source.NOMEN) }.map { it.value as CharSequence } bindTo nomen_et::setText\n+ baseOfNomen.observable.filter { !it.sources.contains(Source.BASE_OF_NOMEN) }.map { it.value } bindTo nomen_base_et::setText\nnomen_base_et.textChanges()\n.debounce(300, TimeUnit.MILLISECONDS)\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/cycled/CycledPresenter.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/cycled/CycledPresenter.kt",
"diff": "@@ -38,16 +38,16 @@ class CycledPresenter @Inject constructor(\nwith(pm) {\nObservable.combineLatest<SourcedValue<String>, SourcedValue<Origin>, Pair<SourcedValue<String>, SourcedValue<Origin>>>(\n- baseOfNomen.getObservable(),\n- origin.getObservable(), BiFunction { t1, t2 -> t1 to t2 }) bindTo { pair ->\n+ baseOfNomen.observable,\n+ origin.observable, BiFunction { t1, t2 -> t1 to t2 }) bindTo { pair ->\nnomenInteractor.composeNomen(pair.first.value, pair.second.value).map {\nSourcedValue(pair.first.sources + pair.second.sources, it)\n} bindTo nomen\n}\nObservable.combineLatest<SourcedValue<String>, SourcedValue<Origin>, Pair<SourcedValue<String>, SourcedValue<Origin>>>(\n- nomen.getObservable(),\n- origin.getObservable(), BiFunction { t1, t2 -> t1 to t2 }) bindTo { pair ->\n+ nomen.observable,\n+ origin.observable, BiFunction { t1, t2 -> t1 to t2 }) bindTo { pair ->\nnomenInteractor.extractBaseOfNomen(pair.first.value, pair.second.value).map {\nSourcedValue(pair.first.sources + pair.second.sources, it)\n} bindTo baseOfNomen\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/easyadapter/ui/screen/main/EAMainActivityView.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/easyadapter/ui/screen/main/EAMainActivityView.kt",
"diff": "@@ -89,10 +89,10 @@ class EAMainActivityView : BaseRxActivityView<MainPresentationModel>() {\nemptyStateController = EmptyStateController()\nObservables.combineLatest(\n- pm.carouselState.getObservable(),\n- pm.elementsState.getObservable(),\n- pm.bottomCarouselState.getObservable(),\n- pm.hasCommercialState.getObservable(),\n+ pm.carouselState.observable,\n+ pm.elementsState.observable,\n+ pm.bottomCarouselState.observable,\n+ pm.hasCommercialState.observable,\n::createItemList\n) bindTo adapter::setItems\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/easyadapter/ui/screen/pagination/PaginationActivityView.kt",
"new_path": "core-mvp-rx-sample/src/main/java/ru/surfstudio/android/core/mvp/rx/sample/easyadapter/ui/screen/pagination/PaginationActivityView.kt",
"diff": "@@ -81,10 +81,10 @@ class PaginationActivityView : BaseRxActivityView<PaginationPresentationModel>()\nelementController = ElementController { showText(\"on element ${it.name} click \") }\nerrorStateController = ErrorStateController { pm.reloadAction.accept() }\n- Observables.combineLatest(pm.loadState.getObservable(),\n- pm.elementsState.getObservable(),\n- pm.stubsState.getObservable(),\n- pm.paginationState.getObservable(),\n+ Observables.combineLatest(pm.loadState.observable,\n+ pm.elementsState.observable,\n+ pm.stubsState.observable,\n+ pm.paginationState.observable,\n::createItemList) bindTo { p -> adapter.setItems(p.first, p.second) }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/domain/Relation.kt",
"new_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/domain/Relation.kt",
"diff": "@@ -41,42 +41,44 @@ interface Related<S : RelationEntity> {\nfun <T> subscribe(observable: Observable<T>, onNext: Consumer<T>): Disposable\n- fun <T> Relation<T, *, S>.getObservable() =\n+ val <T> Relation<T, *, S>.observable: Observable<T>\n+ get() =\nthis.getObservable(relationEntity())\n- fun <T> Relation<T, S, *>.getConsumer() =\n+ val <T> Relation<T, S, *>.consumer: Consumer<T>\n+ get() =\nthis.getConsumer(relationEntity())\nfun <T> Relation<T, S, *>.accept(newValue: T) =\n- this.getConsumer().accept(newValue)\n+ this.consumer.accept(newValue)\nfun Relation<Unit, S, *>.accept() =\n- this.getConsumer().accept(Unit)\n+ this.consumer.accept(Unit)\ninfix fun <T> Observable<T>.bindTo(consumer: Consumer<T>) =\nthis@Related.subscribe(this, consumer)\ninfix fun <T> Observable<T>.bindTo(relation: Relation<T, S, *>) =\n- this.bindTo(relation.getConsumer())\n+ this.bindTo(relation.consumer)\ninfix fun <T> Single<T>.bindTo(consumer: Consumer<T>) =\nthis@Related.subscribe(this.toObservable(), consumer)\ninfix fun <T> Single<T>.bindTo(relation: Relation<T, S, *>) =\n- this.bindTo(relation.getConsumer())\n+ this.bindTo(relation.consumer)\ninfix fun <T> Maybe<T>.bindTo(consumer: Consumer<T>) =\nthis@Related.subscribe(this.toObservable(), consumer)\ninfix fun <T> Maybe<T>.bindTo(relation: Relation<T, S, *>) =\n- this.bindTo(relation.getConsumer())\n+ this.bindTo(relation.consumer)\ninfix fun Completable.bindTo(consumer: Consumer<Unit>) =\nthis@Related.subscribe(this.toObservable(), consumer)\ninfix fun Completable.bindTo(relation: Relation<Unit, S, *>) =\n- this.bindTo(relation.getConsumer())\n+ this.bindTo(relation.consumer)\ninfix fun <T> Observable<T>.bindTo(consumer: (T) -> Unit) =\n@@ -87,15 +89,15 @@ interface Related<S : RelationEntity> {\ninfix fun <T> Relation<T, *, S>.bindTo(consumer: (T) -> Unit) =\n- this.getObservable()\n+ this.observable\n.bindTo(consumer)\ninfix fun Relation<Unit, *, S>.bindTo(consumer: () -> Unit) =\n- this.getObservable()\n+ this.observable\n.bindTo(consumer)\ninfix fun <T> Relation<T, *, S>.bindTo(relation: Relation<T, S, *>) =\n- this.getObservable().bindTo(relation.getConsumer())\n+ this.observable.bindTo(relation.consumer)\n}\ninterface RelationEntity\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/ActionTest.kt",
"new_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/ActionTest.kt",
"diff": "@@ -37,12 +37,12 @@ class ActionTest : BaseRelationTest() {\ntestObservable =\nwith(testPresenter) {\n- action.getObservable().test()\n+ action.observable.test()\n}\ntestConsumer =\nwith(testView) {\n- action.getConsumer()\n+ action.consumer\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/BondTest.kt",
"new_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/BondTest.kt",
"diff": "@@ -40,22 +40,22 @@ class BondTest : BaseRelationTest() {\ntestViewConsumer =\nwith(testView) {\n- twoWay.getConsumer()\n+ twoWay.consumer\n}\ntestViewObservable =\nwith(testView) {\n- twoWay.getObservable().test()\n+ twoWay.observable.test()\n}\ntestPresenterConsumer=\nwith(testPresenter) {\n- twoWay.getConsumer()\n+ twoWay.consumer\n}\ntestPresenterObservable =\nwith(testPresenter) {\n- twoWay.getObservable().test()\n+ twoWay.observable.test()\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/StateTest.kt",
"new_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/domain/StateTest.kt",
"diff": "@@ -37,12 +37,12 @@ class StateTest : BaseRelationTest() {\ntestObservable =\nwith(testView) {\n- state.getObservable().test()\n+ state.observable.test()\n}\ntestConsumer =\nwith(testPresenter) {\n- state.getConsumer()\n+ state.consumer\n}\n}\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-227 fun getObservable -> val observable |
652,304 | 24.01.2019 16:33:14 | -10,800 | ba729525b0930a35e987735de4a47327a0201148 | Update value method | [
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/relation/ValuableRelation.kt",
"new_path": "core-mvp-rx/src/main/java/ru/surfstudio/android/core/mvp/rx/relation/ValuableRelation.kt",
"diff": "@@ -31,4 +31,6 @@ abstract class ValuableRelation<T, in S : RelationEntity, in D : RelationEntity>\nval hasValue: Boolean get() = relay.hasValue()\ninternal val internalValue: T get() = relay.value ?: throw NoSuchElementException()\n+\n+ fun update() = relay.accept(internalValue)\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/relation/ActionTest.kt",
"new_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/relation/ActionTest.kt",
"diff": "@@ -77,4 +77,16 @@ class ActionTest : BaseRelationTest() {\nassertEquals(\"Initial\", newValue)\n}\n}\n+\n+ @Test\n+ @Throws(Exception::class)\n+ fun update() {\n+ with(testPresenter) {\n+ val action = Action(\"Update\")\n+ var newValue = \"\"\n+ action bindTo { newValue += it }\n+ action.update()\n+ assertEquals(\"UpdateUpdate\", newValue)\n+ }\n+ }\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/relation/StateTest.kt",
"new_path": "core-mvp-rx/src/test/java/ru/surfstudio/android/core/mvp/rx/relation/StateTest.kt",
"diff": "@@ -77,4 +77,16 @@ class StateTest : BaseRelationTest() {\nassertEquals(\"Initial\", newValue)\n}\n}\n+\n+ @Test\n+ @Throws(Exception::class)\n+ fun update() {\n+ with(testView) {\n+ val state = State(\"Update\")\n+ var newValue = \"\"\n+ state bindTo { newValue += it }\n+ state.update()\n+ assertEquals(\"UpdateUpdate\", newValue)\n+ }\n+ }\n}\n\\ No newline at end of file\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-227 Update value method |
652,299 | 25.01.2019 12:16:25 | -10,800 | 785ed1317182e4fa5e015380e0fc5894b66ba5c7 | Quick naming fix | [
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/navigator/ActivityNavigator.java",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/activity/navigator/ActivityNavigator.java",
"diff": "@@ -217,7 +217,7 @@ public abstract class ActivityNavigator extends BaseActivityResultDelegate\nif (route instanceof DynamicCrossFeatureRoute && this.isSplitFeatureModeOn) {\nDynamicCrossFeatureRoute dynamicCrossFeatureRoute = (DynamicCrossFeatureRoute) route;\nsplitFeatureInstaller.installFeature(\n- dynamicCrossFeatureRoute.splitName(),\n+ dynamicCrossFeatureRoute.splitNames(),\nnew SplitFeatureInstaller.SplitFeatureInstallListener() {\n@Override\npublic void onInstall(@NotNull SplitFeatureInstallState state) {\n"
},
{
"change_type": "MODIFY",
"old_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/feature/installer/SplitFeatureInstaller.kt",
"new_path": "core-ui/src/main/java/ru/surfstudio/android/core/ui/navigation/feature/installer/SplitFeatureInstaller.kt",
"diff": "@@ -31,6 +31,7 @@ class SplitFeatureInstaller(\n* @param splitName Dynamic Feature name\n* @param splitFeatureInstallListener installation events listener\n*/\n+ @Suppress(\"unused\")\nfun installFeature(\nsplitName: String,\nsplitFeatureInstallListener: SplitFeatureInstallListener\n@@ -44,7 +45,6 @@ class SplitFeatureInstaller(\n* @param splitNames multiple Dynamic Feature names\n* @param splitFeatureInstallListener installation events listener\n*/\n- @Suppress(\"MemberVisibilityCanBePrivate\")\nfun installFeature(\nsplitNames: List<String>,\nsplitFeatureInstallListener: SplitFeatureInstallListener\n"
}
] | Kotlin | Apache License 2.0 | surfstudio/surfandroidstandard | ANDDEP-397 Quick naming fix |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.