mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Compare commits
755 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33bf4bcdef | |||
| 0f235a24a0 | |||
| fc76e0ff59 | |||
| debe6d2378 | |||
| c5701745eb | |||
| d57afb5401 | |||
| 90f06f0820 | |||
| fba2f1d334 | |||
| d169a67879 | |||
| a116462064 | |||
| 9a9543265b | |||
| 8f673d1950 | |||
| 1d66dd937b | |||
| 1f63c2a5da | |||
| 194d5b2fcc | |||
| 1f33c80e85 | |||
| fdb0b081e1 | |||
| fe8ad2b6cf | |||
| 73ab1567f7 | |||
| 431411cded | |||
| 2672cfb638 | |||
| abc836eae5 | |||
| 6c9f06e07f | |||
| 4d1534f998 | |||
| e72041d3fb | |||
| 1d9284980c | |||
| a8c665a89e | |||
| db036e0e2a | |||
| 7c94c481c7 | |||
| e1ac76bbfd | |||
| 59f78161ae | |||
| e7de3e059d | |||
| 631959ba63 | |||
| ce6cf689c8 | |||
| 982b7d2470 | |||
| e6c2060114 | |||
| fea3c4a19d | |||
| d51278bf65 | |||
| 09b9355cf0 | |||
| eb16a0bf74 | |||
| ee9ade04cc | |||
| 5e6b52038c | |||
| 60a42c275d | |||
| 8a7849bb1b | |||
| d709ace71c | |||
| f0d6aa6a87 | |||
| 497d921ef9 | |||
| 8eab9107b7 | |||
| 6f9349e9c2 | |||
| 6261e0eaed | |||
| 6fb810bbb9 | |||
| b573f24b0f | |||
| 867b47d33c | |||
| e88b74164c | |||
| bbcf8fb1dd | |||
| 7a88e28710 | |||
| f42342dea0 | |||
| 633037133d | |||
| 9a48e7fc22 | |||
| 9e7abb5843 | |||
| f7f443b389 | |||
| 80723477ca | |||
| 725be98844 | |||
| 5b506b0f94 | |||
| 20d6c20577 | |||
| 9ad5e88f21 | |||
| 38499761ad | |||
| add621416f | |||
| f872917fd4 | |||
| e502b02cb6 | |||
| be03bc1b5f | |||
| 677a59a8cb | |||
| 6822e0e504 | |||
| 0614e7d426 | |||
| f4fc4e6d86 | |||
| 866396a93b | |||
| 2517cbfb99 | |||
| aab59911fb | |||
| b54a8431b1 | |||
| cb69af5f6d | |||
| 304497a91a | |||
| 18cce1e6f7 | |||
| a86f7efd9e | |||
| 53aba77523 | |||
| af365933a3 | |||
| 51d80e4b25 | |||
| fbbf1a5f3e | |||
| 1006fbb599 | |||
| 1713aa6474 | |||
| ff5acaa7f5 | |||
| 9cb0d119a7 | |||
| 6d75112dfd | |||
| 496c9b082f | |||
| 349fb12a05 | |||
| a7054fc2e6 | |||
| faacf510b2 | |||
| 6ce08ef461 | |||
| f2fb935d3b | |||
| 80ab5305ca | |||
| 3441162de4 | |||
| b695015e8f | |||
| e50bf6ef95 | |||
| 3ca55ad986 | |||
| 40ff8268a8 | |||
| 2e7fac05ba | |||
| a42996892d | |||
| 3e926becba | |||
| a1eeb25dff | |||
| a1f4b64c4a | |||
| 5673b25e52 | |||
| f755add1d2 | |||
| 60dd8098c4 | |||
| 5823d04a20 | |||
| 3cdfa949e9 | |||
| b69eaddddf | |||
| 137b32303f | |||
| da87705fb8 | |||
| d808adeb39 | |||
| 2ca07c6ee9 | |||
| 9a05cd4646 | |||
| 85e16df79a | |||
| 2fd0bdf68b | |||
| 23a2d11944 | |||
| 02e515e531 | |||
| 6651d26a47 | |||
| 84df07dcd1 | |||
| d865b08aa1 | |||
| 220c855222 | |||
| de2fa484ef | |||
| f5c3b79a1d | |||
| 254f489d27 | |||
| 716d42c21a | |||
| 3f3bfa562f | |||
| a11ca07f4e | |||
| 575c275d39 | |||
| acf0d801ce | |||
| 14d810c319 | |||
| 5d7bca4538 | |||
| db48d7be5e | |||
| 234dd6d13e | |||
| 948f89f957 | |||
| b9c64626d1 | |||
| 469169b2f1 | |||
| 113a270407 | |||
| 2469324f65 | |||
| f1b5facc6a | |||
| b0260c352d | |||
| a5168ed1a5 | |||
| 4c9e7cc516 | |||
| 733b123c09 | |||
| dd2b484cdb | |||
| 1b4811e334 | |||
| d23ce67862 | |||
| b26f127fb0 | |||
| 359cebec8e | |||
| ce3bb860b8 | |||
| a1d8cffc85 | |||
| 0b4b11e7f3 | |||
| 50f3ab528d | |||
| a85dcead6b | |||
| 5b1b2a916c | |||
| 53b6adb0a5 | |||
| 0cd5a372d5 | |||
| 69fa2cb4ee | |||
| 52208d8653 | |||
| 3630606f52 | |||
| ac9aa2e6dd | |||
| f72ec65b79 | |||
| b3920d9bf3 | |||
| a828650a44 | |||
| a2c3163df8 | |||
| 15245fa85c | |||
| 28f3288d2a | |||
| 7b69a50623 | |||
| 790e45795c | |||
| 185d7ca4d3 | |||
| 383042d778 | |||
| d39a6f16aa | |||
| 7c9e879454 | |||
| bb283230f4 | |||
| 363d816a17 | |||
| 86eea66267 | |||
| 38e70d8640 | |||
| 652f2d0665 | |||
| 75b430b323 | |||
| 0491f93192 | |||
| 9a33ddbbc4 | |||
| e3e4b509e8 | |||
| 0e6bac1b2f | |||
| ebeb2c9443 | |||
| f00c0a16f1 | |||
| 1733529486 | |||
| a0cd2d0a7c | |||
| 8decc0176f | |||
| 2015a620d6 | |||
| 3e042ff2a2 | |||
| 0768ccb2fd | |||
| ff19d4dae3 | |||
| adc8652cad | |||
| 903e2e9084 | |||
| 2fcc37dddb | |||
| 42c588b51d | |||
| 0d4afae561 | |||
| 76e3422acd | |||
| 4ac2c61556 | |||
| ec0a7dc65c | |||
| fb5543f31c | |||
| a7d8c6af0b | |||
| 0a65209406 | |||
| a5d6150119 | |||
| d49e7ad60e | |||
| 989c3985ca | |||
| fb0f4bfc2b | |||
| e43e30b61a | |||
| 270a695da1 | |||
| d80fba84cf | |||
| e34cd917ea | |||
| 942770372c | |||
| b36477c160 | |||
| c39b16a8d9 | |||
| 0583a0582e | |||
| 4a5e563bda | |||
| f314809a06 | |||
| d561dcb6e6 | |||
| 6f88e49cac | |||
| 751fd56b4e | |||
| b37e7fc9bb | |||
| 5e61857384 | |||
| aee29ad821 | |||
| aad3db6f6a | |||
| 236d54557d | |||
| 27cb4328b2 | |||
| d91c81e0d4 | |||
| 6100589818 | |||
| 09b848f832 | |||
| 14825e97cc | |||
| 669d573345 | |||
| 4231b0282f | |||
| 43448e286b | |||
| ba6d2a3099 | |||
| 8f91e14049 | |||
| 0bf0d0c316 | |||
| b60fd2405a | |||
| a0d4bcc2ac | |||
| aaec546629 | |||
| 88d45ca86c | |||
| 8796e77cc0 | |||
| 07f05000b9 | |||
| 6beb57a2e7 | |||
| 75dc23c907 | |||
| a0d0f23548 | |||
| 136ab5ec01 | |||
| 8578ac67c6 | |||
| 53907bb44e | |||
| e71e67ec6a | |||
| a91e2dd591 | |||
| 1980c70bad | |||
| 97380cd16a | |||
| 01844469a0 | |||
| aace88ebfa | |||
| cb323ee444 | |||
| 4c35109b9b | |||
| efec8c45d9 | |||
| f450b14fa9 | |||
| 91b1155bd4 | |||
| 0917c9cd1d | |||
| 64510a419c | |||
| c01eab9b00 | |||
| 76a1fc4803 | |||
| 01e46c72cd | |||
| 957153e79e | |||
| c3d1b6814c | |||
| d0672865ce | |||
| 74ffbf48be | |||
| 06cb0ff325 | |||
| 5af70bc27c | |||
| 3240a25aef | |||
| 88688e6a81 | |||
| 081e2b23b1 | |||
| cc8e178e85 | |||
| 1411e7be15 | |||
| d5c2a8b9fa | |||
| 60b9085237 | |||
| 828f96a73d | |||
| 2b8cb0c495 | |||
| c0457803c7 | |||
| 3a8b40bfa0 | |||
| 8e8ade004c | |||
| bb7452918d | |||
| 3731884843 | |||
| 28f9eca5e4 | |||
| deda874741 | |||
| ed4ba18767 | |||
| edfbab06db | |||
| bdee370b7e | |||
| 27a4b7637d | |||
| de524cc9f5 | |||
| 274d9b0b8f | |||
| 7af947189b | |||
| ffce932eb9 | |||
| 3ecb5a4330 | |||
| 90cd8838f3 | |||
| ed5c7e549e | |||
| a036d892c5 | |||
| de1d3ef2bf | |||
| 57f58c5619 | |||
| fcf2b8c20a | |||
| ca1a16671a | |||
| 1c52ead6bc | |||
| a9e0f6c8c4 | |||
| 7d7d2acf76 | |||
| ed6e16581d | |||
| 083ecdde1a | |||
| 4e862134ee | |||
| 806574ff8d | |||
| d0571160c4 | |||
| 5a54cd4b8a | |||
| d1f163050c | |||
| 81041c8e89 | |||
| f3508787b8 | |||
| 6fec2424db | |||
| e991a209ea | |||
| 8a85c02aba | |||
| b9edf88093 | |||
| f01fa02082 | |||
| 5e495c4757 | |||
| dd21632e35 | |||
| 5c4898fff7 | |||
| c13a5e9b68 | |||
| 3a21f4a6c4 | |||
| c02aa85cab | |||
| 0e731a954c | |||
| 271ff3cbb8 | |||
| 5ebebc9c43 | |||
| 091a31d975 | |||
| a505f24aa0 | |||
| c58f2017f6 | |||
| dc6b32d389 | |||
| ca23b6e2c5 | |||
| c8a0d268f9 | |||
| 9110ed7c6c | |||
| ecf3330e4c | |||
| 6b3ce880c0 | |||
| 0bbc7677f6 | |||
| ee185d0f87 | |||
| 877ca293a0 | |||
| 809185769a | |||
| fac34140e9 | |||
| ec0fd48a1e | |||
| 0d6d08b911 | |||
| fd8fb3bd55 | |||
| 1faaab1f9c | |||
| 52b6346f08 | |||
| 036cc8a9fa | |||
| 5db22aa4ad | |||
| 2e1e804e8c | |||
| 78a865166c | |||
| 35c9a96c18 | |||
| 3b39ff6649 | |||
| 90722b5ac4 | |||
| 12e0ecf347 | |||
| da664bc881 | |||
| ce37da0084 | |||
| fb874d5359 | |||
| bdc86b0285 | |||
| a6d8386b08 | |||
| b69ca46485 | |||
| cb30257b83 | |||
| 9123210f69 | |||
| 630a259a5a | |||
| f0183064ed | |||
| 11bca87a47 | |||
| 3863b74fbd | |||
| 8216ce7d20 | |||
| a7a06ce26b | |||
| e9e4c01e54 | |||
| 47e2fa4a22 | |||
| 90fad460a6 | |||
| 929962c228 | |||
| a55edf0ba0 | |||
| e255926e10 | |||
| 21ed3e06e6 | |||
| 2ceffb283f | |||
| 2e52bacfba | |||
| 6c624e93b3 | |||
| ee5b2371e0 | |||
| 18297213f2 | |||
| 1373e46d04 | |||
| d7c6bac301 | |||
| b9e3a5454e | |||
| 3decd485ea | |||
| 285fcf3df3 | |||
| 0312960e93 | |||
| cfee7400c9 | |||
| e113fb0902 | |||
| deedd1acac | |||
| e1d912158d | |||
| 373e15b08a | |||
| e2bdb0bf13 | |||
| 19de16887c | |||
| 8609892116 | |||
| 76717b908d | |||
| c57ae9861f | |||
| 63a2899fdc | |||
| 2d86c5b10b | |||
| bd5ba8ebaf | |||
| 0e90ea1308 | |||
| ec05602bb1 | |||
| 2c55c93367 | |||
| b37a91cdd9 | |||
| 223c39d26a | |||
| 0a46073552 | |||
| 0325c9531f | |||
| c4ec5c6e1a | |||
| b00e35f341 | |||
| a935425e5d | |||
| 46fc46ee4f | |||
| d7fcf9433d | |||
| ec921e22e8 | |||
| 55bc139c72 | |||
| a5187ed1a2 | |||
| a79cbe9804 | |||
| dd9d10a991 | |||
| 3c78f6a82f | |||
| 4a30940d54 | |||
| 0c0e1a35e2 | |||
| 0fe4827214 | |||
| 80c8b7ef20 | |||
| 93a99cdd2c | |||
| 76dfa1fca5 | |||
| ba1c32fe05 | |||
| 1c77b0bf4e | |||
| 31331b958f | |||
| 80fc718ec8 | |||
| 823a1e2197 | |||
| 8fad2d0226 | |||
| ad69dc4ad4 | |||
| f8f89497a9 | |||
| 4272ac7619 | |||
| 3e5da102a5 | |||
| 51742716ec | |||
| fb7a106617 | |||
| c016c728d3 | |||
| b6c1d4b768 | |||
| 21cb85ce39 | |||
| fa9f13bba8 | |||
| 7feda6323a | |||
| 4cd02a673f | |||
| 22659c35fb | |||
| a6f89674b8 | |||
| 1bfdbfc00d | |||
| 73686ba57f | |||
| c44c78c87d | |||
| 371042029f | |||
| fa0f66bde2 | |||
| 843c5b548e | |||
| 06a3a6b285 | |||
| d2ac75d526 | |||
| 723b56b2d9 | |||
| 1910ccff83 | |||
| 11e676de2c | |||
| eb2c357868 | |||
| 4020b9c086 | |||
| be0670c592 | |||
| d1786bc9dc | |||
| 215b834da9 | |||
| 5e77be8dd0 | |||
| 913663743c | |||
| 95786d1268 | |||
| cfc69e483e | |||
| 73b59ed4bf | |||
| e8a996d1f3 | |||
| c04ba91b50 | |||
| d763be42a1 | |||
| 10d01b0d68 | |||
| 7699c5e63f | |||
| 78a033a221 | |||
| 7f23570160 | |||
| a9e1dd7e38 | |||
| 058f13f9d8 | |||
| 515fb92873 | |||
| abac76125c | |||
| 149df4e3d7 | |||
| 0a4796e959 | |||
| e79b6d9b1d | |||
| af471f4cf8 | |||
| 1c97c2e408 | |||
| 2c34aa83c3 | |||
| bf93a9e54b | |||
| c7c3990283 | |||
| e4454044f6 | |||
| f6ad0f2ee5 | |||
| 9abf23073d | |||
| 66253123ad | |||
| 920a683e9b | |||
| a0ce2b5dea | |||
| be1e1fa3c1 | |||
| 0a925f8f51 | |||
| 2db619e263 | |||
| e75e9410d6 | |||
| bbc09af77b | |||
| e3d3f13bef | |||
| affe4ca82e | |||
| 3b9a2e2d6d | |||
| dff6fedb67 | |||
| 9615a47f03 | |||
| 87ae709add | |||
| 80ecd1f697 | |||
| 481b5816b1 | |||
| 97da31ae2d | |||
| 48684bded4 | |||
| b191ad8b84 | |||
| 363fa04dca | |||
| e8c11aef6e | |||
| d0df88b113 | |||
| 477f3e638c | |||
| 478e093783 | |||
| a7c13e83c9 | |||
| e9e1db7773 | |||
| f1a2268712 | |||
| d28394d59e | |||
| aa5d6d289a | |||
| 36f56d557d | |||
| e8dcd05f79 | |||
| b29a50304c | |||
| 61355499f4 | |||
| 05fd267cb8 | |||
| 440e3d8a61 | |||
| ab82ed53e5 | |||
| 151c4426ec | |||
| 3c87751491 | |||
| 9f93cb8bd8 | |||
| 5bf9311371 | |||
| 45fede3a02 | |||
| addadf9634 | |||
| 520a7a6e9e | |||
| 65eb204ddc | |||
| 6eee460532 | |||
| c85fa85290 | |||
| 39324c6f73 | |||
| 9702286e59 | |||
| 512acd9fc3 | |||
| 930facc457 | |||
| 5a428458b5 | |||
| fa12c90f23 | |||
| 2e16ccb041 | |||
| df7dda0e96 | |||
| 28c86b4784 | |||
| 175a4ddf95 | |||
| e4b24b0d99 | |||
| 989fcd9564 | |||
| 4877ef1407 | |||
| c1487e3f74 | |||
| 6d4650bba9 | |||
| fb6f02696d | |||
| 8ed4abebb7 | |||
| f90de9c0de | |||
| 206d2a58d2 | |||
| 6001d2fb3a | |||
| 1ceab73dfe | |||
| dc38b949a8 | |||
| 96b740d4da | |||
| 1455f7849b | |||
| 7f14a4da90 | |||
| 0d04064969 | |||
| 37fbda3126 | |||
| 023e62fbd4 | |||
| b818007398 | |||
| 7c1bb82dd4 | |||
| e3a6fa4cac | |||
| 6e6aa88b3a | |||
| c266bd6eba | |||
| e383c2b79a | |||
| 56a5b23d98 | |||
| 10eb41aca7 | |||
| a0a50e3433 | |||
| 07449e9018 | |||
| 5027373b54 | |||
| 1d1e08fc15 | |||
| 6eabf32464 | |||
| acb4a2e5a0 | |||
| ba1b5211a2 | |||
| eb8d248fd9 | |||
| f248a86ce2 | |||
| 8e9b55958d | |||
| 6decd0ee76 | |||
| 16384c12c2 | |||
| 9be5c50e31 | |||
| 46421d8821 | |||
| 13cb356aef | |||
| b210b72460 | |||
| 6aa63f48e1 | |||
| eaba4a4ab7 | |||
| fbc61bce2a | |||
| 5c98e34966 | |||
| 9b461d372d | |||
| b57a81c7c2 | |||
| 7cf41805ec | |||
| 59efa059fd | |||
| e462d66746 | |||
| cd0c3f533a | |||
| 0027b17ef9 | |||
| 9ee5325f29 | |||
| ac433edcf8 | |||
| f71e7e58e1 | |||
| 4af1e9263a | |||
| 01d3a75faa | |||
| d015ab4e93 | |||
| abcf3600a6 | |||
| ac6c497721 | |||
| 2dafecc665 | |||
| 3a48f0a04a | |||
| 1caf3a8956 | |||
| ba1dd07b01 | |||
| 695a97276f | |||
| 0d50753754 | |||
| e357786980 | |||
| 54ab0ba860 | |||
| 44675fffe5 | |||
| e5c6fb0e50 | |||
| 82666fb5f0 | |||
| 9ab86ca310 | |||
| 7153b4c7be | |||
| e73f4f30cb | |||
| e365a20d6e | |||
| 4a9f9eefd2 | |||
| 2ff632bb87 | |||
| f5be0708be | |||
| 92908ab673 | |||
| c20f8699f3 | |||
| 81e60a3916 | |||
| 4f8e25a6c0 | |||
| 4038088c5f | |||
| bc972faf2a | |||
| 0720fec295 | |||
| fba37c7c12 | |||
| debaa48e58 | |||
| c4a63657cd | |||
| a723783c01 | |||
| 26a922e16a | |||
| 9a20d33d55 | |||
| 3abe9946d4 | |||
| dcf4857b6e | |||
| 701ae43bd6 | |||
| cb67d0a45b | |||
| 1684bc3acc | |||
| ee32ef2f09 | |||
| c9ed86a81a | |||
| 8421e85229 | |||
| 0b2eead1be | |||
| 0d30d4a4f3 | |||
| ac55638e46 | |||
| e57c45da71 | |||
| 4b93e2e57c | |||
| 2bab5a65f4 | |||
| 66f379f80b | |||
| 4a8749349f | |||
| 54fe2accb6 | |||
| ec21b57106 | |||
| 9e62523b6d | |||
| 2b69ba5716 | |||
| dadfecf8f3 | |||
| e5695194d5 | |||
| e1c192ddd3 | |||
| ee5e6cb125 | |||
| 5ca9bbff28 | |||
| 1761335092 | |||
| b87e135b3c | |||
| c1154a87cc | |||
| a683880f7e | |||
| 23acff2a87 | |||
| 484d723c75 | |||
| ecab439d0a | |||
| d02732c16d | |||
| f55106612c | |||
| efde505eb5 | |||
| 7ae296dcac | |||
| 8a20f439c0 | |||
| 57a8251313 | |||
| 6039a4e6b1 | |||
| ea59519c09 | |||
| 84e7345607 | |||
| 4357817faf | |||
| fb4f378b86 | |||
| ee081b3037 | |||
| 33d3d92f62 | |||
| 9ba8659536 | |||
| 3c14d32e19 | |||
| 6cb866233b | |||
| e98bffdacc | |||
| 96400768b5 | |||
| dd8474cecf | |||
| 7b98265a2a | |||
| 03a20c26db | |||
| fd0731c52a | |||
| 7856fb22e4 | |||
| d38a4535bb | |||
| 757ad7266f | |||
| da8274de1b | |||
| 22bd12cfd6 | |||
| 6d868cb541 | |||
| ca2ad6fa68 | |||
| 718dd6d1a9 | |||
| b4db0d7d70 | |||
| 0de45907ff | |||
| 9fbc3773b6 | |||
| 4707d43e84 | |||
| dabae2d63a | |||
| 3c9204da0f | |||
| 4b11524fcf | |||
| 7a8c279e4f | |||
| b3708d1bd4 | |||
| 3ffb476aa9 | |||
| 7641975cc6 | |||
| dbc23af348 | |||
| dac8dbd330 | |||
| a47dd34500 | |||
| b160d1b1e9 | |||
| 90d5c4fd2c | |||
| 3311bb56e4 | |||
| d6ff7e4480 | |||
| b7ea939ac7 | |||
| 46a2930fa0 | |||
| e8c6309e93 | |||
| b9a72db110 | |||
| a6d8d0e3b6 | |||
| a7a7e66bb8 | |||
| a2ad1d35e7 | |||
| dd16cc7d89 | |||
| 9673ec1a96 | |||
| 8d8c9b808b | |||
| d379d66751 | |||
| f44989a18d | |||
| 7a5b880a7a | |||
| c859e9bf70 | |||
| 6e4361d129 | |||
| e5cd1be194 | |||
| 5a3faba0a3 | |||
| 0b15b5b55f | |||
| ecd06e4b0f | |||
| 8bf5d98d04 | |||
| b73b1e430e | |||
| 563ec61d52 | |||
| ba02fae57f | |||
| 5c61abe256 | |||
| 0d93f9a678 | |||
| bff79e1c34 | |||
| 68db96483c | |||
| 2bdf88373d | |||
| cdb43876bf | |||
| 6f1cecdaa9 | |||
| 363d78d61c | |||
| 02d9258c9c | |||
| 8a567c63b1 | |||
| 880139b1ff |
@@ -0,0 +1,25 @@
|
||||
# Thank you for contributing to Delta Chat.
|
||||
|
||||
Delta Chat is divided in two parts: Android and [Core](https://github.com/deltachat/deltachat-core).
|
||||
|
||||
In short, the Android part is about the User Interface. The Interface is translated using [Transifex](https://www.transifex.com/delta-chat/delta-chat-android). The Core part is about handling the connection to the mail server and the chat or e-mail messages as well as providing secure communication by using [Autocrypt](https://autocrypt.org/en/latest/).
|
||||
|
||||
Delta Chat Core is used in the Android and in the [iOS](https://github.com/deltachat/deltachat-ios) version.
|
||||
|
||||
Please try to create your issue to the respective Issue tracker: Here, or in [Core](https://github.com/deltachat/deltachat-core/issues). Don't worry, if you are not sure. The issue will be handled anyway.
|
||||
|
||||
If you intend to create a **feature request** for Delta Chat, please check the exiting requests for
|
||||
* [Android](https://github.com/deltachat/deltachat-android/issues?q=is%3Aissue+label%3A%22feature+request%22+sort%3Aupdated-desc) and
|
||||
* [Core](https://github.com/deltachat/deltachat-core/issues?q=is%3Aissue+label%3A%22feature+request%22+sort%3Aupdated-desc)
|
||||
|
||||
first.
|
||||
|
||||
If you intend to send a **bug report** for Delta Chat, search for bugs (including closed) in
|
||||
* [Android](https://github.com/deltachat/deltachat-android/issues?&q=is%3Aissue) and
|
||||
* [Core](https://github.com/deltachat/deltachat-core/issues?&q=is%3Aissue)
|
||||
|
||||
A **bug** is a reproducable misbehaviour, when something happens but something else should happen instead.
|
||||
|
||||
Did you know there is a [Help](https://delta.chat/en/help) page for Delta Chat?
|
||||
|
||||
To ask questions, you are invited to join our IRC channel **#deltachat** on [Freenode](https://webchat.freenode.net/?uio=MTE9MjA16a&channels=%23deltachat).
|
||||
@@ -0,0 +1,34 @@
|
||||
_Please read the guidelines linked above, especially when you are a first time contributor. Remove this text and provide some basic informations below, if applicable. Remove template content that is not applicable._
|
||||
|
||||
**Delta Chat version**
|
||||
|
||||
See settings dialog …
|
||||
|
||||
**Expected behavior**
|
||||
|
||||
What is the expected output?
|
||||
|
||||
**Actual behavior**
|
||||
|
||||
What do you see instead?
|
||||
|
||||
**Steps to reproduce the problem**
|
||||
|
||||
1. …
|
||||
2. …
|
||||
|
||||
**Screen snapshots**
|
||||
|
||||
If applicable …
|
||||
|
||||
**Debug logs**
|
||||
|
||||
If applicable, debug logs can be copied from within the Delta Chat app:
|
||||
|
||||
Open the _Settings_ menu -> _About_ -> _version number|Info_.
|
||||
|
||||
Alternatively from the Android system log:
|
||||
|
||||
` adb logcat -v time -s DeltaChat `
|
||||
|
||||
This log contains private data (e.g. mail address, provider information) which shall be removed or anonymised prior to posting.
|
||||
@@ -9,3 +9,6 @@ libs/
|
||||
|
||||
# ignore private scripts and directories, eg. local2github.prv.sh
|
||||
*.prv*
|
||||
|
||||
# transifex temporary files
|
||||
tools/translations/
|
||||
|
||||
+240
@@ -1,5 +1,245 @@
|
||||
# Delta Chat Changelog
|
||||
|
||||
## v0.18.0
|
||||
2018-06-21
|
||||
|
||||
* Speed up message sending/receiving
|
||||
* Retry failed sending/receiving jobs just in the moment the networks becomes available again
|
||||
* Make message sending/receiving more reliable
|
||||
* Handle attachment file names with non-ASCII characters correctly
|
||||
* Paging through images made available by Angelo Fuchs
|
||||
* Several connection issues with different configurations were fixed by Thomas Oster
|
||||
* Improve chat-folder creation by Thomas Oster
|
||||
* Request permissions before using the camera; added by Thomas Oster
|
||||
* Key import improved by Thomas Oster
|
||||
* Improve background and foreground message fetching reliability
|
||||
* Try to use the permanent notification only when really needed
|
||||
* Update internal sqlite library from 3.22.0 to 3.23.1
|
||||
* Update internal libEtPan library from 1.7 to 1.8
|
||||
* Add Danish translation from Ole Carlsen
|
||||
* Update Albania, Basque, Danish, Italian, Norwegian, Dutch, Polish, Portuguese, Russian and Telugu translations
|
||||
|
||||
## v0.17.3
|
||||
2018-05-17
|
||||
|
||||
* Fix system messages appearing twice
|
||||
* Fix: Use all gossipped verifications in verified groups
|
||||
* Update Basque, Polish, Russian and Ukrainian translations
|
||||
|
||||
## v0.17.2
|
||||
2018-05-15
|
||||
|
||||
* Fix problem with adding formerly uncontacted members to groups
|
||||
* Unblock manually blocked members when they are created manually as contact again
|
||||
|
||||
## v0.17.1
|
||||
2018-05-11
|
||||
|
||||
* Improve QR code scanning screens
|
||||
* Add a labs-option to disabled the new QR logo overlay
|
||||
* Update Russian translations
|
||||
|
||||
## v0.17.0
|
||||
2018-05-07
|
||||
|
||||
* Show shared chats in user profiles
|
||||
* If a contact has changed his encryption setups, this is shown as a system messages in the middle of the chat view
|
||||
* Show added group members, changed group titles etc. as system messages
|
||||
* Show direct buttons to create a new group or contact in the "New Chat" dialog
|
||||
* Improve "Add contact" dialog
|
||||
* Move subject and most chat metadata to the encrypted part following the "Memoryhole" proposal
|
||||
* Show read-timestamps in message info
|
||||
* Do not add contacts from Bcc to group-memberlist to avoid privacy leaks and to get a unique memberlist for all group-members
|
||||
* In a mail contains plaintext and encrypted parts, the whole mail is treated as not being encrypted correctly
|
||||
* Restructure settings and advanced settings
|
||||
* Fix problems with Office 365 and similar services
|
||||
* Fix a problem where incoming messages are shown as being sent by oneself
|
||||
* Experimental QR code scanning options can be enabled in the advanced settings
|
||||
* Update Albanian, Catalan, Dutch, French, German, Italian, Norwegian, Polish, Russian, Spanish, Turkish and Ukrainian translations
|
||||
* Add Basque translation
|
||||
* Add Chinese translation
|
||||
* Add Japanese translation
|
||||
|
||||
## v0.16.0
|
||||
2018-03-19
|
||||
|
||||
* Messages from normal clients to more than one recipient create an implicit "ad-hoc group"
|
||||
* Allow group creation though contact requests
|
||||
* Always display the _sending_ time in the chat list; the list itself is sorted by _receiving_ time and "Message info" shows both times now
|
||||
* If parts but the footnote are cut from mails, this is indicated "..."; use "Message info" to get the full text
|
||||
* Highlight the subject in the "Message info"
|
||||
* Autoconfigure prefers 'https' over 'http'
|
||||
* Bug fixes, eg. avoid freezes if the connection is lost
|
||||
* Update Russian, Tamil and Turkish translations
|
||||
|
||||
This version requires access to the camera for upcoming QR code scanning options which can be tested already in this version, see commit
|
||||
[74ffbf4](https://github.com/deltachat/deltachat-android/commit/74ffbf48befbb0416337673d73d9f2482728cac6).
|
||||
|
||||
## v0.15.0
|
||||
2018-02-27
|
||||
|
||||
* Render the waveform for voice messages
|
||||
* Fix problems with voice messages on various devices
|
||||
* Improve deletion of message that were moved around by another e-mail client
|
||||
* Really delete messages on the server, do not only mark them for deletion
|
||||
* Ignore subsequent keys or blocks in OpenPGP files
|
||||
* Leave incoming Autocrypt Setup Messages in the inbox so that any number of other e-mail-clients can process them
|
||||
* Avoid messages sent to the "Me" chat appearing twice in other e-mail clients
|
||||
* Update Albanian translation
|
||||
|
||||
## v0.14.0
|
||||
2018-02-20
|
||||
|
||||
* Evaluate gossiped keys
|
||||
* Option to transfer the Autocrypt Setup to another device or e-mail client
|
||||
* Accept Autocrypt Setup transferred from other devices or e-mail client
|
||||
* Send any data from device to device using the chat "Me - Messages I sent to myself"
|
||||
* Do not send messages when there is an access error
|
||||
* Request for contact permissions only once
|
||||
* Bug fixes
|
||||
* Update French and Turkish translations
|
||||
|
||||
## v0.13.0
|
||||
2018-01-18
|
||||
|
||||
* Reply encrypted if the sender has enabled encryption manually (esp. useful when chatting with clients as K-9 or Enigmail)
|
||||
* Update welcome screen graphics
|
||||
* Update Norwegian, Russian and Turkish translations
|
||||
|
||||
## v0.12.0
|
||||
2018-01-07
|
||||
|
||||
* Gossip keys of other group members in the encrypted payload (will also be evaluated in one of the next versions)
|
||||
* Use SHA-256 instead of SHA-1 in signatures
|
||||
* Make the permanent notification clickable
|
||||
* Update permanent notification after import
|
||||
* Fix rendering of system messages
|
||||
* Various bug fixes
|
||||
* Update Albanian, French, Italian, Norwegian, Polish, Russian and Turkish translations
|
||||
|
||||
## v0.11.4
|
||||
2017-12-17
|
||||
|
||||
* Add option to initiate Autocrypt Key Transfer
|
||||
* Connect after importing a backup
|
||||
* Reading memory hole headers
|
||||
* Add Albanian translation
|
||||
* Update German, Italian, Polish, Portuguese, Russian, Turkish and Ukrainian translations
|
||||
|
||||
## v0.10.0
|
||||
2017-11-29
|
||||
|
||||
* Fix usage of multiple private keys
|
||||
* Fix various memory leaks
|
||||
* Update English, Portuguese and Turkish translations
|
||||
|
||||
## v0.9.9
|
||||
2017-11-18
|
||||
|
||||
* Alternate include order for F-Droid
|
||||
* Add Serbian translation
|
||||
* Update Catalan, Dutch, English, French, German, Hungarian, Italian, Polish, Portuguese, Russian, Spanish, Tamil, Telugu and Ukrainian translations
|
||||
|
||||
## v0.9.8
|
||||
2017-11-15
|
||||
|
||||
* Fix a bug that avoids chat creation under some circumstances (bug introduced in 0.9.7)
|
||||
|
||||
## v0.9.7
|
||||
2017-11-14
|
||||
|
||||
* Archive chats or delete chats by a long press
|
||||
* Notify the user in the chatlist about contact requests of known users or of other Delta Chat clients
|
||||
* Show messages only for explicitly wanted chats
|
||||
* Show more detailed reasons about failed end-to-end-encryptions
|
||||
* Explicit option to leave a group
|
||||
* Do not show the padlock if end-to-end-encryption is disabled by the user
|
||||
* Also import images from a backup when using a different device with different paths
|
||||
* Add copy-to-clipboard function for "About / Info"
|
||||
* Rework Emoji-code
|
||||
* Add Norwegian Bokmål translation
|
||||
* Add Tamil translation
|
||||
* Add Turkish translation
|
||||
* Update Catalan, German, French, Italian, Korean, Dutch, Polish, Portuguese, Russian, Telugu and Ukrainian translations
|
||||
|
||||
## v0.9.6
|
||||
2017-10-18
|
||||
|
||||
* Support keys generated with multiple subkeys eg. from K-9
|
||||
* Show PDFs and other attachments with bad names
|
||||
* Bug fixes
|
||||
|
||||
## v0.9.5
|
||||
2017-10-08
|
||||
|
||||
* Backup export and import function
|
||||
* Query password before export
|
||||
* Move replies from normal E-Mail-Clients to the "Chats" folder
|
||||
* Improve helping MUAs on showing chat threads
|
||||
* Improve onboarding
|
||||
* Add URL to default footer
|
||||
* Test a different approach for battery saving in this release
|
||||
* Update French, Italian, German, Polish, Portuguese, Russian and Ukrainian translations
|
||||
|
||||
## v0.9.4
|
||||
2017-08-23
|
||||
|
||||
* Introduce an editable "Status" field that is shown eg. in email footers
|
||||
* Editable and synchronized group images
|
||||
* Show the subject of messages that cannot be decrypted
|
||||
* Do not send "Read receipts" when decryption fails
|
||||
* Do not request "Read receipts" from normal MUAs as there are too many MUAs responding with weird, non-standard formats
|
||||
* Deleting a chat always deletes all messages from the device permanently
|
||||
* Ignore messages from mailing lists
|
||||
* Do not spread the original authors name nor address on forwarding
|
||||
* Encrypt mails send to SMTP and to IMAP the same way
|
||||
* Improve showing HTML-mails
|
||||
* Cleanup Android code
|
||||
* Remove badge counter on app restart
|
||||
* Add Ukrainian translation
|
||||
* Add Telugu translation
|
||||
* Add Catalan translation
|
||||
* Update German, Spanish, French, Hungarian, Italian, Polish, Portuguese and Russian translations
|
||||
|
||||
## v0.9.3
|
||||
2017-07-13
|
||||
|
||||
* Introduce "Read receipts" and avoid social pressure to leave it activated
|
||||
* Improve encryption dialog in profile
|
||||
* Fix marking messages as "seen" when opening the contact requests
|
||||
* Ignore signature.asc files of signed-only messages
|
||||
* Update Polish, Portuguese and Russian translations
|
||||
|
||||
## v0.9.2
|
||||
2017-06-28
|
||||
|
||||
* Encrypt group chats
|
||||
* Cryptographically sign messages
|
||||
* Validate signatures of incoming messages ("Info" shows the state)
|
||||
* Show a little lock beside end-to-end-encrypted messages with a validated signature
|
||||
* If end-to-end-encryption is available on sending time, guarantee the message not to be sent without end-to-end-encryption later
|
||||
* Show special characters in HTML-mails
|
||||
* Help MUAs on showing chat threads
|
||||
* Show attachments from multipart/alternative structures
|
||||
* Upgrade from Autocrypt Level 0 to Level 1; as the levels are not compatible, encryption on mixed setups does not happen
|
||||
* Update Polish, Portuguese, Spanish and French translations
|
||||
|
||||
## v0.9.1
|
||||
2017-06-04
|
||||
|
||||
* Profile: Improve encryption state dialog
|
||||
* Improved video quality of short clips
|
||||
* Make encryption-dialog localizable
|
||||
* Update Russian translation
|
||||
|
||||
## v0.9.0
|
||||
2017-06-01
|
||||
|
||||
* Add end-to-end-encrypting following the OpenPGP and Autocrypt standards
|
||||
* Add a function to compare keys
|
||||
* Profile: Add option to copy the email address to the clipboard
|
||||
* Pimp GUI
|
||||
|
||||
## v0.1.36
|
||||
2017-05-04
|
||||
|
||||
|
||||
+17
-10
@@ -27,12 +27,14 @@ dependencies {
|
||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||
compile 'com.googlecode.mp4parser:isoparser:1.0.6'
|
||||
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||
compile 'com.google.zxing:core:3.3.0'
|
||||
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
|
||||
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
compileSdkVersion 25 // should be ...
|
||||
buildToolsVersion '25.0.2' // ... in sync unless you know exactly what you're doing
|
||||
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
defaultConfig.applicationId = "com.b44t.messenger"
|
||||
@@ -48,7 +50,10 @@ android {
|
||||
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file("config/debug.keystore")
|
||||
def debugKeystore = file("config/debug.keystore")
|
||||
if (debugKeystore.exists()) {
|
||||
storeFile debugKeystore
|
||||
}
|
||||
}
|
||||
|
||||
release {
|
||||
@@ -76,13 +81,12 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig.versionCode = 36
|
||||
|
||||
sourceSets.main {
|
||||
jniLibs.srcDir 'libs'
|
||||
jni.srcDirs = [] //disable automatic ndk-build call
|
||||
}
|
||||
|
||||
flavorDimensions "none"
|
||||
productFlavors {
|
||||
/*
|
||||
x86 {
|
||||
@@ -105,19 +109,22 @@ android {
|
||||
}
|
||||
*/
|
||||
fat {
|
||||
versionCode = 3
|
||||
dimension "none"
|
||||
//versionCode = 3
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
/*applicationVariants.all { variant ->
|
||||
def abiVersion = variant.productFlavors.get(0).versionCode
|
||||
variant.mergedFlavor.versionCode = defaultConfig.versionCode * 10 + abiVersion;
|
||||
}
|
||||
}*/
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 14 // 14: Android 4.0 Ice Cream Sandwich 2011 (Telegram default), 21: Android 5.0 Lollipop 2014 (recommended for InstantRun)
|
||||
minSdkVersion 14 // 14: Android 4.0 Ice Cream Sandwich 2011 (Telegram default), 21: Android 5.0 Lollipop 2014 (provides JobScheduler, recommended for InstantRun)
|
||||
targetSdkVersion 25 // 25: Nougat. CAVE: Do NOT target "Andoid O" without checking the background tasks carefully, see https://developer.android.com/preview/behavior-changes.html#back-all . As long as we target "Nougat", everything works as expected even for "Andoid O" or later
|
||||
// in general, we should not change the target without reason; eg. after the switch to Nougat, the camera stops working (see https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en )
|
||||
versionName "0.1.36" // do NOT forget to increase defaultConfig.versionCode!
|
||||
|
||||
versionName "0.18.0" // do NOT forget to increase defaultConfig.versionCode!
|
||||
versionCode 530
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,6 +493,19 @@ local_src_files := \
|
||||
./openssl/crypto/buffer/buf_err.c \
|
||||
./openssl/crypto/buffer/buf_str.c \
|
||||
./openssl/crypto/buffer/buffer.c \
|
||||
./openssl/crypto/camellia/camellia.c \
|
||||
./openssl/crypto/camellia/cmll_cbc.c \
|
||||
./openssl/crypto/camellia/cmll_cfb.c \
|
||||
./openssl/crypto/camellia/cmll_ctr.c \
|
||||
./openssl/crypto/camellia/cmll_ecb.c \
|
||||
./openssl/crypto/camellia/cmll_misc.c \
|
||||
./openssl/crypto/camellia/cmll_ofb.c \
|
||||
./openssl/crypto/camellia/cmll_utl.c \
|
||||
./openssl/crypto/cast/c_cfb64.c \
|
||||
./openssl/crypto/cast/c_ecb.c \
|
||||
./openssl/crypto/cast/c_enc.c \
|
||||
./openssl/crypto/cast/c_ofb64.c \
|
||||
./openssl/crypto/cast/c_skey.c \
|
||||
./openssl/crypto/cmac/cm_ameth.c \
|
||||
./openssl/crypto/cmac/cm_pmeth.c \
|
||||
./openssl/crypto/cmac/cmac.c \
|
||||
@@ -610,6 +623,8 @@ local_src_files := \
|
||||
./openssl/crypto/evp/e_aes.c \
|
||||
./openssl/crypto/evp/e_aes_cbc_hmac_sha1.c \
|
||||
./openssl/crypto/evp/e_bf.c \
|
||||
./openssl/crypto/evp/e_camellia.c \
|
||||
./openssl/crypto/evp/e_cast.c \
|
||||
./openssl/crypto/evp/e_des.c \
|
||||
./openssl/crypto/evp/e_des3.c \
|
||||
./openssl/crypto/evp/e_null.c \
|
||||
@@ -1178,9 +1193,6 @@ LOCAL_SRC_FILES := \
|
||||
./messenger-backend/libs/libetpan/src/low-level/mime/mailmime_write_file.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/mime/mailmime_write_generic.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/mime/mailmime_write_mem.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/nntp/newsnntp.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/nntp/newsnntp_socket.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/nntp/newsnntp_ssl.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/smtp/mailsmtp.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/smtp/mailsmtp_helper.c \
|
||||
./messenger-backend/libs/libetpan/src/low-level/smtp/mailsmtp_oauth2.c \
|
||||
@@ -1188,6 +1200,7 @@ LOCAL_SRC_FILES := \
|
||||
./messenger-backend/libs/libetpan/src/low-level/smtp/mailsmtp_ssl.c \
|
||||
./messenger-backend/libs/libetpan/src/main/libetpan_version.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/implementation/data-message/data_message_driver.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/implementation/mime-message/mime_message_driver.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/maildriver.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/maildriver_tools.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/maildriver_types.c \
|
||||
@@ -1197,7 +1210,9 @@ LOCAL_SRC_FILES := \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/mailmessage_tools.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/mailmessage_types.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/mailstorage.c \
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/mailstorage_tools.c
|
||||
./messenger-backend/libs/libetpan/src/driver/interface/mailstorage_tools.c \
|
||||
./messenger-backend/libs/libetpan/src/engine/mailprivacy.c \
|
||||
./messenger-backend/libs/libetpan/src/engine/mailprivacy_tools.c
|
||||
LOCAL_C_INCLUDES = \
|
||||
$(LOCAL_PATH)/messenger-backend/libs/libetpan/src \
|
||||
$(LOCAL_PATH)/messenger-backend/libs/libetpan/src/data-types \
|
||||
@@ -1220,7 +1235,6 @@ LOCAL_C_INCLUDES = \
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# cyrus sasl
|
||||
################################################################################
|
||||
@@ -1294,6 +1308,7 @@ LOCAL_MODULE := sqlite
|
||||
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
|
||||
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -DHAVE_STRCHRNUL=0
|
||||
LOCAL_CFLAGS += -DSQLITE_OMIT_LOAD_EXTENSION
|
||||
LOCAL_CFLAGS += -DSQLITE_MAX_MMAP_SIZE=0 -DSQLITE_OMIT_WAL # HACK: the defines are used to skip the pointer reference to mmap set in aSyscall[] - mmap seems to be a #define that cannot be used this way on Android - otherwise we get the error: 'mmap' undeclared here (not in a function)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
./messenger-backend/libs/sqlite/sqlite3.c
|
||||
@@ -1492,6 +1507,7 @@ $(LOCAL_PATH)/breakpad/common/android/include \
|
||||
$(LOCAL_PATH)/breakpad \
|
||||
$(LOCAL_PATH)/ffmpeg \
|
||||
$(LOCAL_PATH)/messenger-backend/libs/libetpan/include \
|
||||
$(LOCAL_PATH)/messenger-backend/libs/netpgp/include \
|
||||
$(LOCAL_PATH)/messenger-backend/libs/sqlite
|
||||
|
||||
#LOCAL_SRC_FILES += \
|
||||
@@ -1599,28 +1615,59 @@ LOCAL_SRC_FILES += \
|
||||
./image.c \
|
||||
./video.c \
|
||||
./gifvideo.cpp \
|
||||
./messenger-backend/libs/netpgp/src/compress.c \
|
||||
./messenger-backend/libs/netpgp/src/create.c \
|
||||
./messenger-backend/libs/netpgp/src/crypto.c \
|
||||
./messenger-backend/libs/netpgp/src/keyring.c \
|
||||
./messenger-backend/libs/netpgp/src/misc.c \
|
||||
./messenger-backend/libs/netpgp/src/openssl_crypto.c \
|
||||
./messenger-backend/libs/netpgp/src/packet-parse.c \
|
||||
./messenger-backend/libs/netpgp/src/packet-show.c \
|
||||
./messenger-backend/libs/netpgp/src/reader.c \
|
||||
./messenger-backend/libs/netpgp/src/signature.c \
|
||||
./messenger-backend/libs/netpgp/src/symmetric.c \
|
||||
./messenger-backend/libs/netpgp/src/validate.c \
|
||||
./messenger-backend/libs/netpgp/src/writer.c \
|
||||
./messenger-backend/src/mraheader.c \
|
||||
./messenger-backend/src/mrapeerstate.c \
|
||||
./messenger-backend/src/mrarray.c \
|
||||
./messenger-backend/src/mrchat.c \
|
||||
./messenger-backend/src/mrchatlist.c \
|
||||
./messenger-backend/src/mrcmdline.c \
|
||||
./messenger-backend/src/mrcontact.c \
|
||||
./messenger-backend/src/mre2ee.c \
|
||||
./messenger-backend/src/mrdehtml.c \
|
||||
./messenger-backend/src/mrhash.c \
|
||||
./messenger-backend/src/mrimap.c \
|
||||
./messenger-backend/src/mrjob.c \
|
||||
./messenger-backend/src/mrkey.c \
|
||||
./messenger-backend/src/mrkeyring.c \
|
||||
./messenger-backend/src/mrloginparam.c \
|
||||
./messenger-backend/src/mrlot.c \
|
||||
./messenger-backend/src/mrmailbox.c \
|
||||
./messenger-backend/src/mrmailbox_configure.c \
|
||||
./messenger-backend/src/mrmailbox_connect.c \
|
||||
./messenger-backend/src/mrmailbox_e2ee.c \
|
||||
./messenger-backend/src/mrmailbox_imex.c \
|
||||
./messenger-backend/src/mrmailbox_keyhistory.c \
|
||||
./messenger-backend/src/mrmailbox_log.c \
|
||||
./messenger-backend/src/mrmailbox_qr.c \
|
||||
./messenger-backend/src/mrmailbox_receive_imf.c \
|
||||
./messenger-backend/src/mrmailbox_securejoin.c \
|
||||
./messenger-backend/src/mrmimefactory.c \
|
||||
./messenger-backend/src/mrmimeparser.c \
|
||||
./messenger-backend/src/mrmsg.c \
|
||||
./messenger-backend/src/mrosnative.c \
|
||||
./messenger-backend/src/mrparam.c \
|
||||
./messenger-backend/src/mrpoortext.c \
|
||||
./messenger-backend/src/mrpgp.c \
|
||||
./messenger-backend/src/mrsaxparser.c \
|
||||
./messenger-backend/src/mrsimplify.c \
|
||||
./messenger-backend/src/mrsmtp.c \
|
||||
./messenger-backend/src/mrsqlite3.c \
|
||||
./messenger-backend/src/mrstock.c \
|
||||
./messenger-backend/src/mrstrbuilder.c \
|
||||
./messenger-backend/src/mrstrencode.c \
|
||||
./messenger-backend/src/mrtoken.c \
|
||||
./messenger-backend/src/mrtools.c \
|
||||
./messenger-backend/src/mruudecode.c \
|
||||
./messenger-backend/cmdline/cmdline.c \
|
||||
./mrwrapper.c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_PLATFORM := android-9
|
||||
APP_PLATFORM := android-14
|
||||
APP_ABI := armeabi armeabi-v7a x86
|
||||
NDK_TOOLCHAIN_VERSION := 4.9
|
||||
APP_STL := gnustl_static
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -403,7 +403,7 @@
|
||||
/* #undef STATIC_LDAPDB */
|
||||
|
||||
/* Link LOGIN Staticly */
|
||||
/* #undef STATIC_LOGIN */
|
||||
#define STATIC_LOGIN
|
||||
|
||||
/* Link NTLM Staticly */
|
||||
/* #undef STATIC_NTLM */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
Submodule MessengerProj/jni/messenger-backend updated: ef4868b018...5bb60f4ded
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
+506
-268
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
LOCAL_CFLAGS += -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN #-DTERMIO
|
||||
|
||||
# From DEPFLAG=
|
||||
LOCAL_CFLAGS += -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CAST -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL
|
||||
LOCAL_CFLAGS += -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL
|
||||
|
||||
# Extra
|
||||
LOCAL_CFLAGS += -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<uses-permission android:name="android.permission.INSTALL_SHORTCUT" />
|
||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||
<!-- <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" /> - required for AndroidUtilities.uninstallShortcut() -->
|
||||
<!-- <uses-permission android:name="android.permission.CAMERA" /> - also disabled in T'gram; we're using the camera via an intent only -->
|
||||
<uses-permission android:name="android.permission.CAMERA" /> <!-- needed for qr code scanning, not needed for taking photos (we're using an intent for this) -->
|
||||
|
||||
<application
|
||||
android:name=".ApplicationLoader"
|
||||
@@ -53,7 +53,7 @@
|
||||
android:supportsRtl="true">
|
||||
|
||||
<activity
|
||||
android:name="com.b44t.ui.LaunchActivity"
|
||||
android:name=".LaunchActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
@@ -105,17 +105,24 @@
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- if used, add 'android:manageSpaceActivity="com.b44t.ui.ManageSpaceActivity"' to application-tag
|
||||
|
||||
<activity
|
||||
android:name="com.b44t.ui.ManageSpaceActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
</activity> -->
|
||||
<activity
|
||||
android:name="com.b44t.ui.IntroActivity"
|
||||
android:name=".WelcomeActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".QRshowActivity"
|
||||
android:theme="@style/Theme.MessengerProj.AppCompat"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".QRscanActivity"
|
||||
android:theme="@style/Theme.MessengerProj.AppCompat"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.b44t.messenger.OpenChatReceiver"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||
|
||||
+17
-42
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,14 +21,13 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
@@ -40,7 +39,7 @@ import android.widget.ImageView;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -56,6 +55,10 @@ public class ActionBar extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public static final int TITLE_WITHOUT_BACK_X = 16; /*original value: 18*/
|
||||
public static final int TITLE_AFTER_BACK_X = 58; /*original value: 72*/
|
||||
public static final int AVATAR_AFTER_BACK_X = 48; /*original value: 56, you have also to adapt the animation, if you change this value (see ProfileActivity.ANIM_OFF) */
|
||||
|
||||
private ImageView backButtonImageView;
|
||||
private SimpleTextView titleTextView;
|
||||
private SimpleTextView subtitleTextView;
|
||||
@@ -68,7 +71,6 @@ public class ActionBar extends FrameLayout {
|
||||
private boolean interceptTouches = true;
|
||||
private AnimatorSet actionModeAnimation;
|
||||
|
||||
private boolean allowOverlayTitle;
|
||||
private CharSequence lastTitle;
|
||||
private boolean castShadows = true;
|
||||
|
||||
@@ -374,10 +376,6 @@ public class ActionBar extends FrameLayout {
|
||||
if (subtitleTextView != null) {
|
||||
subtitleTextView.setVisibility(visible ? INVISIBLE : VISIBLE);
|
||||
}
|
||||
Drawable drawable = backButtonImageView.getDrawable();
|
||||
if (drawable != null && drawable instanceof MenuDrawable) {
|
||||
((MenuDrawable) drawable).setRotation(visible ? 1 : 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void setInterceptTouches(boolean value) {
|
||||
@@ -410,15 +408,15 @@ public class ActionBar extends FrameLayout {
|
||||
int textLeft;
|
||||
if (backButtonImageView != null && backButtonImageView.getVisibility() != GONE) {
|
||||
backButtonImageView.measure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(54), MeasureSpec.EXACTLY), actionBarHeightSpec);
|
||||
textLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 80 : 72);
|
||||
textLeft = AndroidUtilities.dp(TITLE_AFTER_BACK_X);
|
||||
} else {
|
||||
textLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 26 : 18);
|
||||
textLeft = AndroidUtilities.dp(TITLE_WITHOUT_BACK_X);
|
||||
}
|
||||
|
||||
if (menu != null && menu.getVisibility() != GONE) {
|
||||
int menuWidth;
|
||||
if (isSearchFieldVisible) {
|
||||
menuWidth = MeasureSpec.makeMeasureSpec(width - AndroidUtilities.dp(AndroidUtilities.isTablet() ? 74 : 66), MeasureSpec.EXACTLY);
|
||||
menuWidth = MeasureSpec.makeMeasureSpec(width - AndroidUtilities.dp(TITLE_AFTER_BACK_X), MeasureSpec.EXACTLY);
|
||||
} else {
|
||||
menuWidth = MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST);
|
||||
}
|
||||
@@ -429,12 +427,11 @@ public class ActionBar extends FrameLayout {
|
||||
int availableWidth = width - (menu != null ? menu.getMeasuredWidth() : 0) - AndroidUtilities.dp(16) - textLeft;
|
||||
|
||||
if (titleTextView != null && titleTextView.getVisibility() != GONE) {
|
||||
titleTextView.setTextSize(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 18 : 20);
|
||||
titleTextView.setTextSize(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 18 : 20);
|
||||
titleTextView.measure(MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(24), MeasureSpec.AT_MOST));
|
||||
|
||||
}
|
||||
if (subtitleTextView != null && subtitleTextView.getVisibility() != GONE) {
|
||||
//subtitleTextView.setTextSize(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 14 : 16);
|
||||
subtitleTextView.measure(MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(20), MeasureSpec.AT_MOST));
|
||||
}
|
||||
}
|
||||
@@ -456,27 +453,27 @@ public class ActionBar extends FrameLayout {
|
||||
int textLeft;
|
||||
if (backButtonImageView != null && backButtonImageView.getVisibility() != GONE) {
|
||||
backButtonImageView.layout(0, additionalTop, backButtonImageView.getMeasuredWidth(), additionalTop + backButtonImageView.getMeasuredHeight());
|
||||
textLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 80 : 72);
|
||||
textLeft = AndroidUtilities.dp(TITLE_AFTER_BACK_X);
|
||||
} else {
|
||||
textLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 26 : 18);
|
||||
textLeft = AndroidUtilities.dp(TITLE_WITHOUT_BACK_X);
|
||||
}
|
||||
|
||||
if (menu != null && menu.getVisibility() != GONE) {
|
||||
int menuLeft = isSearchFieldVisible ? AndroidUtilities.dp(AndroidUtilities.isTablet() ? 74 : 66) : (right - left) - menu.getMeasuredWidth();
|
||||
int menuLeft = isSearchFieldVisible ? AndroidUtilities.dp(TITLE_AFTER_BACK_X) : (right - left) - menu.getMeasuredWidth();
|
||||
menu.layout(menuLeft, additionalTop, menuLeft + menu.getMeasuredWidth(), additionalTop + menu.getMeasuredHeight());
|
||||
}
|
||||
|
||||
if (titleTextView != null && titleTextView.getVisibility() != GONE) {
|
||||
int textTop;
|
||||
if (subtitleTextView != null && subtitleTextView.getVisibility() != GONE) {
|
||||
textTop = (getCurrentActionBarHeight() / 2 - titleTextView.getTextHeight()) / 2 + AndroidUtilities.dp(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 2 : 3);
|
||||
textTop = (getCurrentActionBarHeight() / 2 - titleTextView.getTextHeight()) / 2 + AndroidUtilities.dp(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 2 : 3);
|
||||
} else {
|
||||
textTop = (getCurrentActionBarHeight() - titleTextView.getTextHeight()) / 2;
|
||||
}
|
||||
titleTextView.layout(textLeft, additionalTop + textTop, textLeft + titleTextView.getMeasuredWidth(), additionalTop + textTop + titleTextView.getTextHeight());
|
||||
}
|
||||
if (subtitleTextView != null && subtitleTextView.getVisibility() != GONE) {
|
||||
int textTop = getCurrentActionBarHeight() / 2 + (getCurrentActionBarHeight() / 2 - subtitleTextView.getTextHeight()) / 2 - AndroidUtilities.dp(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 1 : 1);
|
||||
int textTop = getCurrentActionBarHeight() / 2 + (getCurrentActionBarHeight() / 2 - subtitleTextView.getTextHeight()) / 2 - AndroidUtilities.dp(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 1 : 1);
|
||||
subtitleTextView.layout(textLeft, additionalTop + textTop, textLeft + subtitleTextView.getMeasuredWidth(), additionalTop + textTop + subtitleTextView.getTextHeight());
|
||||
}
|
||||
|
||||
@@ -543,26 +540,6 @@ public class ActionBar extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void setAllowOverlayTitle(boolean value) {
|
||||
allowOverlayTitle = value;
|
||||
}
|
||||
|
||||
public void setTitleOverlayText(String text) {
|
||||
/* EDIT BY MR
|
||||
if (!allowOverlayTitle || parentFragment.parentLayout == null) {
|
||||
return;
|
||||
}
|
||||
CharSequence textToSet = text != null ? text : lastTitle;
|
||||
if (textToSet != null && titleTextView == null) {
|
||||
createTitleTextView();
|
||||
}
|
||||
if (titleTextView != null) {
|
||||
titleTextView.setVisibility(textToSet != null && !isSearchFieldVisible ? VISIBLE : INVISIBLE);
|
||||
titleTextView.setText(textToSet);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public boolean isSearchFieldVisible() {
|
||||
return isSearchFieldVisible;
|
||||
}
|
||||
@@ -599,9 +576,7 @@ public class ActionBar extends FrameLayout {
|
||||
}
|
||||
|
||||
public static int getCurrentActionBarHeight() {
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
return AndroidUtilities.dp(64);
|
||||
} else if (ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
if (ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
return AndroidUtilities.dp(48);
|
||||
} else {
|
||||
return AndroidUtilities.dp(56);
|
||||
+50
-209
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -49,7 +49,7 @@ import android.widget.LinearLayout;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -60,7 +60,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
boolean needPresentFragment(BaseFragment fragment, boolean removeLast, boolean forceWithoutAnimation, ActionBarLayout layout);
|
||||
boolean needAddFragmentToStack(BaseFragment fragment, ActionBarLayout layout);
|
||||
boolean needCloseLastFragment(ActionBarLayout layout);
|
||||
void onRebuildAllFragments(ActionBarLayout layout);
|
||||
}
|
||||
|
||||
public class LinearLayoutContainer extends LinearLayout {
|
||||
@@ -131,7 +130,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
|
||||
private LinearLayoutContainer containerView;
|
||||
private LinearLayoutContainer containerViewBack;
|
||||
private DrawerLayoutContainer drawerLayoutContainer;
|
||||
private ActionBar currentActionBar;
|
||||
|
||||
private AnimatorSet currentAnimation;
|
||||
@@ -153,16 +151,12 @@ public class ActionBarLayout extends FrameLayout {
|
||||
private int startedTrackingPointerId;
|
||||
private Runnable onCloseAnimationEndRunnable;
|
||||
private Runnable onOpenAnimationEndRunnable;
|
||||
private boolean useAlphaAnimations;
|
||||
private View backgroundView;
|
||||
private boolean removeActionBarExtraHeight;
|
||||
private Runnable animationRunnable;
|
||||
|
||||
private float animationProgress = 0.0f;
|
||||
private long lastFrameTime;
|
||||
|
||||
private String titleOverlayText;
|
||||
|
||||
private ActionBarLayoutDelegate delegate = null;
|
||||
protected Activity parentActivity = null;
|
||||
|
||||
@@ -385,7 +379,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
lastFragment.actionBar.setOccupyStatusBar(false);
|
||||
}
|
||||
containerViewBack.addView(lastFragment.actionBar);
|
||||
lastFragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||
}
|
||||
containerViewBack.addView(fragmentView);
|
||||
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
|
||||
@@ -678,7 +671,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
parent.removeView(fragment.actionBar);
|
||||
}
|
||||
containerViewBack.addView(fragment.actionBar);
|
||||
fragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||
}
|
||||
|
||||
containerViewBack.addView(fragmentView);
|
||||
@@ -702,110 +694,56 @@ public class ActionBarLayout extends FrameLayout {
|
||||
bringChildToFront(containerView);
|
||||
if (!needAnimation) {
|
||||
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
||||
if (backgroundView != null) {
|
||||
backgroundView.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (needAnimation) {
|
||||
if (useAlphaAnimations && fragmentsStack.size() == 1) {
|
||||
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
||||
|
||||
transitionAnimationStartTime = System.currentTimeMillis();
|
||||
transitionAnimationInProgress = true;
|
||||
onOpenAnimationEndRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
fragment.onTransitionAnimationEnd(true, false);
|
||||
fragment.onBecomeFullyVisible();
|
||||
}
|
||||
};
|
||||
ArrayList<Animator> animators = new ArrayList<>();
|
||||
animators.add(ObjectAnimator.ofFloat(this, "alpha", 0.0f, 1.0f));
|
||||
if (backgroundView != null) {
|
||||
backgroundView.setVisibility(VISIBLE);
|
||||
animators.add(ObjectAnimator.ofFloat(backgroundView, "alpha", 0.0f, 1.0f));
|
||||
}
|
||||
|
||||
fragment.onTransitionAnimationStart(true, false);
|
||||
currentAnimation = new AnimatorSet();
|
||||
currentAnimation.playTogether(animators);
|
||||
currentAnimation.setInterpolator(accelerateDecelerateInterpolator);
|
||||
currentAnimation.setDuration(200);
|
||||
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
onAnimationEndCheck(false);
|
||||
}
|
||||
});
|
||||
currentAnimation.start();
|
||||
} else {
|
||||
transitionAnimationStartTime = System.currentTimeMillis();
|
||||
transitionAnimationInProgress = true;
|
||||
onOpenAnimationEndRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT > 15) {
|
||||
containerView.setLayerType(LAYER_TYPE_NONE, null);
|
||||
containerViewBack.setLayerType(LAYER_TYPE_NONE, null);
|
||||
}
|
||||
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
||||
fragment.onTransitionAnimationEnd(true, false);
|
||||
fragment.onBecomeFullyVisible();
|
||||
containerView.setTranslationX(0);
|
||||
}
|
||||
};
|
||||
fragment.onTransitionAnimationStart(true, false);
|
||||
AnimatorSet animation = fragment.onCustomTransitionAnimation(true, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
onAnimationEndCheck(false);
|
||||
}
|
||||
});
|
||||
if (animation == null) {
|
||||
containerView.setAlpha(0.0f);
|
||||
containerView.setTranslationX(48.0f);
|
||||
if (containerView.isKeyboardVisible || containerViewBack.isKeyboardVisible) {
|
||||
waitingForKeyboardCloseRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (waitingForKeyboardCloseRunnable != this) {
|
||||
return;
|
||||
}
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
};
|
||||
AndroidUtilities.runOnUIThread(waitingForKeyboardCloseRunnable, 200);
|
||||
} else if (fragment.needDelayOpenAnimation()) {
|
||||
delayedOpenAnimationRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (delayedOpenAnimationRunnable != this) {
|
||||
return;
|
||||
}
|
||||
delayedOpenAnimationRunnable = null;
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
};
|
||||
AndroidUtilities.runOnUIThread(delayedOpenAnimationRunnable, 200);
|
||||
} else {
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
} else {
|
||||
transitionAnimationStartTime = System.currentTimeMillis();
|
||||
transitionAnimationInProgress = true;
|
||||
onOpenAnimationEndRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Build.VERSION.SDK_INT > 15) {
|
||||
//containerView.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
//containerViewBack.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
containerView.setLayerType(LAYER_TYPE_NONE, null);
|
||||
containerViewBack.setLayerType(LAYER_TYPE_NONE, null);
|
||||
}
|
||||
containerView.setAlpha(1.0f);
|
||||
containerView.setTranslationX(0.0f);
|
||||
currentAnimation = animation;
|
||||
presentFragmentInternalRemoveOld(removeLast, currentFragment);
|
||||
fragment.onTransitionAnimationEnd(true, false);
|
||||
fragment.onBecomeFullyVisible();
|
||||
containerView.setTranslationX(0);
|
||||
}
|
||||
};
|
||||
fragment.onTransitionAnimationStart(true, false);
|
||||
{
|
||||
containerView.setAlpha(0.0f);
|
||||
containerView.setTranslationX(48.0f);
|
||||
if (containerView.isKeyboardVisible || containerViewBack.isKeyboardVisible) {
|
||||
waitingForKeyboardCloseRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (waitingForKeyboardCloseRunnable != this) {
|
||||
return;
|
||||
}
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
};
|
||||
AndroidUtilities.runOnUIThread(waitingForKeyboardCloseRunnable, 200);
|
||||
} else if (fragment.needDelayOpenAnimation()) {
|
||||
delayedOpenAnimationRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (delayedOpenAnimationRunnable != this) {
|
||||
return;
|
||||
}
|
||||
delayedOpenAnimationRunnable = null;
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
};
|
||||
AndroidUtilities.runOnUIThread(delayedOpenAnimationRunnable, 200);
|
||||
} else {
|
||||
startLayoutAnimation(true, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (backgroundView != null) {
|
||||
backgroundView.setAlpha(1.0f);
|
||||
backgroundView.setVisibility(VISIBLE);
|
||||
}
|
||||
fragment.onTransitionAnimationStart(true, false);
|
||||
fragment.onTransitionAnimationEnd(true, false);
|
||||
fragment.onBecomeFullyVisible();
|
||||
@@ -895,7 +833,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
parent.removeView(previousFragment.actionBar);
|
||||
}
|
||||
containerView.addView(previousFragment.actionBar);
|
||||
previousFragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||
}
|
||||
containerView.addView(fragmentView);
|
||||
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
|
||||
@@ -932,13 +869,8 @@ public class ActionBarLayout extends FrameLayout {
|
||||
previousFragmentFinal.onBecomeFullyVisible();
|
||||
}
|
||||
};
|
||||
AnimatorSet animation = currentFragment.onCustomTransitionAnimation(false, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
onAnimationEndCheck(false);
|
||||
}
|
||||
});
|
||||
if (animation == null) {
|
||||
|
||||
{
|
||||
if (containerView.isKeyboardVisible || containerViewBack.isKeyboardVisible) {
|
||||
waitingForKeyboardCloseRunnable = new Runnable() {
|
||||
@Override
|
||||
@@ -953,12 +885,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
} else {
|
||||
startLayoutAnimation(false, true);
|
||||
}
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT > 15) {
|
||||
//containerView.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
//containerViewBack.setLayerType(LAYER_TYPE_HARDWARE, null);
|
||||
}
|
||||
currentAnimation = animation;
|
||||
}
|
||||
} else {
|
||||
currentFragment.onTransitionAnimationEnd(false, false);
|
||||
@@ -966,53 +892,8 @@ public class ActionBarLayout extends FrameLayout {
|
||||
previousFragment.onBecomeFullyVisible();
|
||||
}
|
||||
} else {
|
||||
if (useAlphaAnimations) {
|
||||
transitionAnimationStartTime = System.currentTimeMillis();
|
||||
transitionAnimationInProgress = true;
|
||||
|
||||
onCloseAnimationEndRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
removeFragmentFromStackInternal(currentFragment);
|
||||
setVisibility(GONE);
|
||||
if (backgroundView != null) {
|
||||
backgroundView.setVisibility(GONE);
|
||||
}
|
||||
if (drawerLayoutContainer != null) {
|
||||
drawerLayoutContainer.setAllowOpenDrawer(true, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ArrayList<Animator> animators = new ArrayList<>();
|
||||
animators.add(ObjectAnimator.ofFloat(this, "alpha", 1.0f, 0.0f));
|
||||
if (backgroundView != null) {
|
||||
animators.add(ObjectAnimator.ofFloat(backgroundView, "alpha", 1.0f, 0.0f));
|
||||
}
|
||||
|
||||
currentAnimation = new AnimatorSet();
|
||||
currentAnimation.playTogether(animators);
|
||||
currentAnimation.setInterpolator(accelerateDecelerateInterpolator);
|
||||
currentAnimation.setDuration(200);
|
||||
currentAnimation.addListener(new AnimatorListenerAdapterProxy() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
transitionAnimationStartTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
onAnimationEndCheck(false);
|
||||
}
|
||||
});
|
||||
currentAnimation.start();
|
||||
} else {
|
||||
removeFragmentFromStackInternal(currentFragment);
|
||||
setVisibility(GONE);
|
||||
if (backgroundView != null) {
|
||||
backgroundView.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
removeFragmentFromStackInternal(currentFragment);
|
||||
setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1056,7 +937,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
parent.removeView(previousFragment.actionBar);
|
||||
}
|
||||
containerView.addView(previousFragment.actionBar);
|
||||
previousFragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||
}
|
||||
containerView.addView(fragmentView);
|
||||
ViewGroup.LayoutParams layoutParams = fragmentView.getLayoutParams();
|
||||
@@ -1078,11 +958,7 @@ public class ActionBarLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
public void removeFragmentFromStack(BaseFragment fragment) {
|
||||
if (useAlphaAnimations && fragmentsStack.size() == 1 && AndroidUtilities.isTablet()) {
|
||||
closeLastFragment(true);
|
||||
} else {
|
||||
removeFragmentFromStackInternal(fragment);
|
||||
}
|
||||
removeFragmentFromStackInternal(fragment);
|
||||
}
|
||||
|
||||
public void removeAllFragments() {
|
||||
@@ -1092,16 +968,6 @@ public class ActionBarLayout extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void rebuildAllFragmentViews(boolean last) {
|
||||
for (int a = 0; a < fragmentsStack.size() - (last ? 0 : 1); a++) {
|
||||
fragmentsStack.get(a).clearViews();
|
||||
fragmentsStack.get(a).setParentLayout(this);
|
||||
}
|
||||
if (delegate != null) {
|
||||
delegate.onRebuildAllFragments(this);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_MENU && !checkTransitionAnimation() && !startedTracking && currentActionBar != null) {
|
||||
currentActionBar.onMenuButtonPressed();
|
||||
@@ -1184,35 +1050,10 @@ public class ActionBarLayout extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void setUseAlphaAnimations(boolean value) {
|
||||
useAlphaAnimations = value;
|
||||
}
|
||||
|
||||
public void setBackgroundView(View view) {
|
||||
backgroundView = view;
|
||||
}
|
||||
|
||||
public void setDrawerLayoutContainer(DrawerLayoutContainer layout) {
|
||||
drawerLayoutContainer = layout;
|
||||
}
|
||||
|
||||
public DrawerLayoutContainer getDrawerLayoutContainer() {
|
||||
return drawerLayoutContainer;
|
||||
}
|
||||
|
||||
public void setRemoveActionBarExtraHeight(boolean value) {
|
||||
removeActionBarExtraHeight = value;
|
||||
}
|
||||
|
||||
public void setTitleOverlayText(String text) {
|
||||
titleOverlayText = text;
|
||||
for (BaseFragment fragment : fragmentsStack) {
|
||||
if (fragment.actionBar != null) {
|
||||
fragment.actionBar.setTitleOverlayText(titleOverlayText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlappingRendering() {
|
||||
return false;
|
||||
+5
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -32,7 +32,7 @@ import android.widget.Toast;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class ActionBarMenu extends LinearLayout {
|
||||
|
||||
@@ -103,7 +103,8 @@ public class ActionBarMenu extends LinearLayout {
|
||||
case R.drawable.photo_crop: hint = ApplicationLoader.applicationContext.getString(R.string.CropImage); break;
|
||||
case R.drawable.photo_tools: hint = ApplicationLoader.applicationContext.getString(R.string.EditImage); break;
|
||||
case R.drawable.ic_ab_search: hint = ApplicationLoader.applicationContext.getString(R.string.Search); break;
|
||||
case R.drawable.lock_close: hint = ApplicationLoader.applicationContext.getString(R.string.Passcode); break;
|
||||
case R.drawable.ic_ab_lock_screen: hint = ApplicationLoader.applicationContext.getString(R.string.Passcode); break;
|
||||
case R.drawable.ic_ab_qr: hint = ApplicationLoader.applicationContext.getString(R.string.QrScan); break;
|
||||
}
|
||||
if( hint != null ) {
|
||||
if( s_menuItemHint != null ) {
|
||||
+5
-22
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
@@ -47,9 +47,7 @@ import android.widget.TextView;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class ActionBarMenuItem extends FrameLayout {
|
||||
|
||||
@@ -214,7 +212,7 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||
subMenuOpenSide = side;
|
||||
}
|
||||
|
||||
public TextView addSubItem(int id, String text, int icon) {
|
||||
public TextView addSubItem(int id, String text) {
|
||||
if (popupLayout == null) {
|
||||
rect = new Rect();
|
||||
location = new int[2];
|
||||
@@ -251,15 +249,6 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||
textView.setMinWidth(AndroidUtilities.dp(196));
|
||||
textView.setTag(id);
|
||||
textView.setText(text);
|
||||
if (icon != 0) {
|
||||
textView.setCompoundDrawablePadding(AndroidUtilities.dp(12));
|
||||
if (!LocaleController.isRTL) {
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(icon), null, null, null);
|
||||
} else {
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(icon), null);
|
||||
}
|
||||
}
|
||||
//popupLayout.setShowedFromBotton(showFromBottom);
|
||||
popupLayout.addView(textView);
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) textView.getLayoutParams();
|
||||
layoutParams.gravity = Gravity.START;
|
||||
@@ -466,13 +455,7 @@ public class ActionBarMenuItem extends FrameLayout {
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
|
||||
mCursorDrawableRes.setAccessible(true);
|
||||
mCursorDrawableRes.set(searchField, R.drawable.search_carret);
|
||||
} catch (Exception e) {
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
searchField.setTextIsSelectable(false);
|
||||
if( applyHack ) {
|
||||
searchField.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
//Thanks to https://github.com/JakeWharton/ActionBarSherlock/
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -44,7 +44,7 @@ import android.widget.ScrollView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
+3
-8
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,9 +21,8 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@@ -286,10 +285,6 @@ public class BaseFragment {
|
||||
|
||||
}
|
||||
|
||||
protected AnimatorSet onCustomTransitionAnimation(boolean isOpen, final Runnable callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onLowMemory() {
|
||||
|
||||
}
|
||||
@@ -312,7 +307,7 @@ public class BaseFragment {
|
||||
}
|
||||
try {
|
||||
visibleDialog = dialog;
|
||||
visibleDialog.setCanceledOnTouchOutside(true);
|
||||
//visibleDialog.setCanceledOnTouchOutside(true); -- we do overwrite this from time to time manually, eg. for showing the setup code. so, not all dialogs should be cancelled when touching outside!
|
||||
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
+4
-8
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -60,7 +60,7 @@ import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -307,11 +307,7 @@ public class BottomSheet extends Dialog {
|
||||
if (containerView != null) {
|
||||
if (!fullWidth) {
|
||||
int widthSpec;
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
widthSpec = MeasureSpec.makeMeasureSpec((int) (Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) * 0.8f) + backgroundPaddingLeft * 2, MeasureSpec.EXACTLY);
|
||||
} else {
|
||||
widthSpec = MeasureSpec.makeMeasureSpec(isPortrait ? width + backgroundPaddingLeft * 2 : (int) Math.max(width * 0.8f, Math.min(AndroidUtilities.dp(480), width)) + backgroundPaddingLeft * 2, MeasureSpec.EXACTLY);
|
||||
}
|
||||
widthSpec = MeasureSpec.makeMeasureSpec(isPortrait ? width + backgroundPaddingLeft * 2 : (int) Math.max(width * 0.8f, Math.min(AndroidUtilities.dp(480), width)) + backgroundPaddingLeft * 2, MeasureSpec.EXACTLY);
|
||||
containerView.measure(widthSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
|
||||
} else {
|
||||
containerView.measure(MeasureSpec.makeMeasureSpec(width + backgroundPaddingLeft * 2, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+19
-15
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.ActionBar;
|
||||
package com.b44t.messenger.ActionBar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
@@ -39,7 +39,7 @@ import android.os.Build;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.ChatAttachAlert;
|
||||
import com.b44t.messenger.Components.ChatAttachAlert;
|
||||
|
||||
public class Theme {
|
||||
|
||||
@@ -60,22 +60,17 @@ public class Theme {
|
||||
|
||||
public static final int ATTACH_SHEET_TEXT_COLOR = 0xff757575;
|
||||
|
||||
public static final int DIALOGS_TITLE_TEXT_COLOR = 0xff000000;
|
||||
public static final int DIALOGS_MESSAGE_TEXT_COLOR = 0xff8f8f8f;
|
||||
public static final int DIALOGS_NAME_TEXT_COLOR = 0xff555555;
|
||||
public static final int DIALOGS_SELF_TEXT_COLOR = 0xff00a60e; // from encrypted chat title: 0xff00a60e, alternative: 0xff3c912e
|
||||
public static final int DIALOGS_PRINTING_TEXT_COLOR = 0xff4d83b3;
|
||||
public static final int DIALOGS_DRAFT_TEXT_COLOR = 0xffdd4b39;
|
||||
public static final int CHATLIST_BACKGROUND_COLOR = 0xffffffff;
|
||||
public static final int CHATLIST_DEADDROP_BACKGROUND_COLOR = 0xffd3d3d3;
|
||||
public static final int CHATLIST_TITLE_TEXT_COLOR = 0xff000000;
|
||||
public static final int CHATLIST_MESSAGE_TEXT_COLOR = 0xff8f8f8f;
|
||||
public static final int CHATLIST_NAME_TEXT_COLOR = 0xff555555;
|
||||
public static final int CHATLIST_SELF_TEXT_COLOR = 0xff00a60e; // from encrypted chat title: 0xff00a60e, alternative: 0xff3c912e
|
||||
public static final int CHATLIST_DRAFT_TEXT_COLOR = 0xffdd4b39;
|
||||
|
||||
public static final int CHAT_BOTTOM_OVERLAY_TEXT_COLOR = 0xff7f7f7f;
|
||||
public static final int CHAT_EMPTY_VIEW_TEXT_COLOR = 0xffffffff;
|
||||
|
||||
public static final int STICKERS_SHEET_TITLE_TEXT_COLOR = 0xff212121;
|
||||
public static final int STICKERS_SHEET_SEND_TEXT_COLOR = 0xff3a8ccf;
|
||||
public static final int STICKERS_SHEET_ADD_TEXT_COLOR = 0xff3a8ccf;
|
||||
public static final int STICKERS_SHEET_CLOSE_TEXT_COLOR = 0xff3a8ccf;
|
||||
public static final int STICKERS_SHEET_REMOVE_TEXT_COLOR = 0xffcd5a5a;
|
||||
|
||||
public static final int MSG_SELECTED_BACKGROUND_COLOR = 0x6633b5e5;
|
||||
public static final int MSG_STICKER_NAME_TEXT_COLOR = 0xffffffff;
|
||||
public static final int MSG_IN_TIME_N_FWD_TEXT_COLOR = 0xff9ea7b0;
|
||||
@@ -96,6 +91,8 @@ public class Theme {
|
||||
public static final int MSG_AUDIO_SEEKBAR_DARK_COLOR = 0xFFf68751; // same color as in audio-icon, also used for the record-button
|
||||
public static final int MSG_AUDIO_SEEKBAR_LITE_COLOR = 0xFFfbc8af;
|
||||
|
||||
public static final int MSG_SYSTEM_CMD_COLOR = MSG_AUDIO_NAME_COLOR; // just the same color, there is no other dependency between system commands and audio messages
|
||||
|
||||
public static Drawable backgroundDrawableIn;
|
||||
public static Drawable backgroundDrawableInSelected;
|
||||
public static Drawable backgroundDrawableOut;
|
||||
@@ -110,6 +107,9 @@ public class Theme {
|
||||
public static Drawable systemDrawable;
|
||||
public static Drawable timeBackgroundDrawable;
|
||||
public static Drawable timeStickerBackgroundDrawable;
|
||||
public static Drawable encrOutDrawable;
|
||||
public static Drawable encrInDrawable;
|
||||
public static Drawable encrMediaDrawable;
|
||||
|
||||
public static Drawable[] cornerOuter = new Drawable[4];
|
||||
public static Drawable[] cornerInner = new Drawable[4];
|
||||
@@ -147,6 +147,10 @@ public class Theme {
|
||||
timeStickerBackgroundDrawable = context.getResources().getDrawable(R.drawable.phototime2);
|
||||
systemDrawable = context.getResources().getDrawable(R.drawable.system);
|
||||
|
||||
encrInDrawable = context.getResources().getDrawable(R.drawable.msg_encr_in);
|
||||
encrOutDrawable = context.getResources().getDrawable(R.drawable.msg_encr_out);
|
||||
encrMediaDrawable = context.getResources().getDrawable(R.drawable.msg_encr_media);
|
||||
|
||||
inlistDrawable[INLIST_FILE] = context.getResources().getDrawable(R.drawable.attach_file_inlist);
|
||||
inlistDrawable[INLIST_PLAY] = context.getResources().getDrawable(R.drawable.attach_audio_inlist_play);
|
||||
inlistDrawable[INLIST_TRANSP_PLAY] = context.getResources().getDrawable(R.drawable.video_play);
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -51,6 +51,7 @@ import android.support.v4.content.FileProvider;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.StateSet;
|
||||
@@ -60,15 +61,11 @@ import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.EdgeEffect;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.b44t.ui.Components.ForegroundDetector;
|
||||
import com.b44t.ui.Components.TypefaceSpan;
|
||||
import com.b44t.messenger.Components.ForegroundDetector;
|
||||
import com.b44t.messenger.Components.TypefaceSpan;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
@@ -83,9 +80,7 @@ import java.nio.channels.FileChannel;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class AndroidUtilities {
|
||||
|
||||
@@ -98,35 +93,16 @@ public class AndroidUtilities {
|
||||
public static DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
public static int leftBaseline;
|
||||
public static boolean usingHardwareInput;
|
||||
private static Boolean isTablet = null;
|
||||
private static int adjustOwnerClassGuid = 0;
|
||||
|
||||
static {
|
||||
try {
|
||||
final String GOOD_IRI_CHAR = "a-zA-Z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF";
|
||||
final Pattern IP_ADDRESS = Pattern.compile(
|
||||
"((25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(25[0-5]|2[0-4]"
|
||||
+ "[0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]"
|
||||
+ "[0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}"
|
||||
+ "|[1-9][0-9]|[0-9]))");
|
||||
final String IRI = "[" + GOOD_IRI_CHAR + "]([" + GOOD_IRI_CHAR + "\\-]{0,61}[" + GOOD_IRI_CHAR + "]){0,1}";
|
||||
final String GOOD_GTLD_CHAR = "a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF";
|
||||
final String GTLD = "[" + GOOD_GTLD_CHAR + "]{2,63}";
|
||||
final String HOST_NAME = "(" + IRI + "\\.)+" + GTLD;
|
||||
final Pattern DOMAIN_NAME = Pattern.compile("(" + HOST_NAME + "|" + IP_ADDRESS + ")");
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density;
|
||||
leftBaseline = isTablet() ? 80 : 72;
|
||||
leftBaseline = 72;
|
||||
checkDisplaySize();
|
||||
}
|
||||
|
||||
public static void requestAdjustResize(Activity activity, int classGuid) {
|
||||
if (activity == null || isTablet()) {
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
@@ -134,7 +110,7 @@ public class AndroidUtilities {
|
||||
}
|
||||
|
||||
public static void removeAdjustResize(Activity activity, int classGuid) {
|
||||
if (activity == null || isTablet()) {
|
||||
if (activity == null ) {
|
||||
return;
|
||||
}
|
||||
if (adjustOwnerClassGuid == classGuid) {
|
||||
@@ -330,43 +306,6 @@ public class AndroidUtilities {
|
||||
ApplicationLoader.applicationHandler.removeCallbacks(runnable);
|
||||
}
|
||||
|
||||
public static boolean isTablet() {
|
||||
/* -- we do not make any special for tablet or not. _If_ sth. like this is desired, check for an appropriate screen size.
|
||||
if (isTablet == null) {
|
||||
isTablet = ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet);
|
||||
}
|
||||
return isTablet;
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSmallTablet() {
|
||||
/*
|
||||
float minSide = Math.min(displaySize.x, displaySize.y) / density;
|
||||
return minSide <= 700;
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getMinTabletSide() {
|
||||
if (!isSmallTablet()) {
|
||||
int smallSide = Math.min(displaySize.x, displaySize.y);
|
||||
int leftSide = smallSide * 35 / 100;
|
||||
if (leftSide < dp(320)) {
|
||||
leftSide = dp(320);
|
||||
}
|
||||
return smallSide - leftSide;
|
||||
} else {
|
||||
int smallSide = Math.min(displaySize.x, displaySize.y);
|
||||
int maxSide = Math.max(displaySize.x, displaySize.y);
|
||||
int leftSide = maxSide * 35 / 100;
|
||||
if (leftSide < dp(320)) {
|
||||
leftSide = dp(320);
|
||||
}
|
||||
return Math.min(smallSide, maxSide - leftSide);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getPhotoSize() {
|
||||
if (photoSize == null) {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
@@ -378,19 +317,6 @@ public class AndroidUtilities {
|
||||
return photoSize;
|
||||
}
|
||||
|
||||
public static void clearCursorDrawable(EditText editText) {
|
||||
if (editText == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
|
||||
mCursorDrawableRes.setAccessible(true);
|
||||
mCursorDrawableRes.setInt(editText, 0);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static Intent createShortcutIntent(int did, Bitmap bitmap) {
|
||||
Intent shortcutIntent = new Intent(ApplicationLoader.applicationContext, OpenChatReceiver.class);
|
||||
|
||||
@@ -509,59 +435,67 @@ public class AndroidUtilities {
|
||||
}
|
||||
}
|
||||
|
||||
public static final int FLAG_TAG_BR = 1;
|
||||
public static final int FLAG_TAG_BOLD = 2;
|
||||
public static final int FLAG_TAG_COLOR = 4;
|
||||
public static final int FLAG_TAG_ALL = FLAG_TAG_BR | FLAG_TAG_BOLD | FLAG_TAG_COLOR;
|
||||
|
||||
public static SpannableStringBuilder replaceTags(String str) {
|
||||
return replaceTags(str, FLAG_TAG_ALL);
|
||||
}
|
||||
|
||||
public static SpannableStringBuilder replaceTags(String str, int flag) {
|
||||
try {
|
||||
int start;
|
||||
int end;
|
||||
StringBuilder stringBuilder = new StringBuilder(str);
|
||||
if ((flag & FLAG_TAG_BR) != 0) {
|
||||
while ((start = stringBuilder.indexOf("<br>")) != -1) {
|
||||
stringBuilder.replace(start, start + 4, "\n");
|
||||
}
|
||||
while ((start = stringBuilder.indexOf("<br/>")) != -1) {
|
||||
stringBuilder.replace(start, start + 5, "\n");
|
||||
}
|
||||
|
||||
// breaks
|
||||
while ((start = stringBuilder.indexOf("<br>")) != -1) {
|
||||
stringBuilder.replace(start, start + 4, "\n");
|
||||
}
|
||||
while ((start = stringBuilder.indexOf("<br/>")) != -1) {
|
||||
stringBuilder.replace(start, start + 5, "\n");
|
||||
}
|
||||
|
||||
// bold
|
||||
ArrayList<Integer> bolds = new ArrayList<>();
|
||||
if ((flag & FLAG_TAG_BOLD) != 0) {
|
||||
while ((start = stringBuilder.indexOf("<b>")) != -1) {
|
||||
stringBuilder.replace(start, start + 3, "");
|
||||
end = stringBuilder.indexOf("</b>");
|
||||
if (end == -1) {
|
||||
end = stringBuilder.indexOf("<b>");
|
||||
}
|
||||
stringBuilder.replace(end, end + 4, "");
|
||||
bolds.add(start);
|
||||
bolds.add(end);
|
||||
while ((start = stringBuilder.indexOf("<b>")) != -1) {
|
||||
stringBuilder.replace(start, start + 3, "");
|
||||
end = stringBuilder.indexOf("</b>");
|
||||
if (end == -1) {
|
||||
end = stringBuilder.indexOf("<b>");
|
||||
}
|
||||
stringBuilder.replace(end, end + 4, "");
|
||||
bolds.add(start);
|
||||
bolds.add(end);
|
||||
}
|
||||
|
||||
// italics
|
||||
ArrayList<Integer> italics = new ArrayList<>();
|
||||
while ((start = stringBuilder.indexOf("<i>")) != -1) {
|
||||
stringBuilder.replace(start, start + 3, "");
|
||||
end = stringBuilder.indexOf("</i>");
|
||||
if (end == -1) {
|
||||
end = stringBuilder.indexOf("<i>");
|
||||
}
|
||||
stringBuilder.replace(end, end + 4, "");
|
||||
italics.add(start);
|
||||
italics.add(end);
|
||||
}
|
||||
|
||||
// color - used eg. by the message preview when following a mailto:-link
|
||||
ArrayList<Integer> colors = new ArrayList<>();
|
||||
if ((flag & FLAG_TAG_COLOR) != 0) { // used eg. by the message preview when following a mailto:-link
|
||||
while ((start = stringBuilder.indexOf("<c#")) != -1) {
|
||||
stringBuilder.replace(start, start + 2, "");
|
||||
end = stringBuilder.indexOf(">", start);
|
||||
int color = Color.parseColor(stringBuilder.substring(start, end));
|
||||
stringBuilder.replace(start, end + 1, "");
|
||||
end = stringBuilder.indexOf("</c>");
|
||||
stringBuilder.replace(end, end + 4, "");
|
||||
colors.add(start);
|
||||
colors.add(end);
|
||||
colors.add(color);
|
||||
}
|
||||
while ((start = stringBuilder.indexOf("<c#")) != -1) {
|
||||
stringBuilder.replace(start, start + 2, "");
|
||||
end = stringBuilder.indexOf(">", start);
|
||||
int color = Color.parseColor(stringBuilder.substring(start, end));
|
||||
stringBuilder.replace(start, end + 1, "");
|
||||
end = stringBuilder.indexOf("</c>");
|
||||
stringBuilder.replace(end, end + 4, "");
|
||||
colors.add(start);
|
||||
colors.add(end);
|
||||
colors.add(color);
|
||||
}
|
||||
|
||||
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(stringBuilder);
|
||||
for (int a = 0; a < bolds.size() / 2; a++) {
|
||||
spannableStringBuilder.setSpan(new TypefaceSpan(Typeface.DEFAULT_BOLD), bolds.get(a * 2), bolds.get(a * 2 + 1), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
for (int a = 0; a < italics.size() / 2; a++) {
|
||||
spannableStringBuilder.setSpan(new StyleSpan(Typeface.ITALIC), italics.get(a * 2), italics.get(a * 2 + 1), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
for (int a = 0; a < colors.size() / 3; a++) {
|
||||
spannableStringBuilder.setSpan(new ForegroundColorSpan(colors.get(a * 3 + 2)), colors.get(a * 3), colors.get(a * 3 + 1), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
@@ -886,8 +820,8 @@ public class AndroidUtilities {
|
||||
public static void openForViewOrShare(Activity activity, int msg_id, String cmd)
|
||||
{
|
||||
MrMsg msg = MrMailbox.getMsg(msg_id);
|
||||
String path = msg.getParam('f', "");
|
||||
String mimeType = getMimetype(path, msg.getParam('m', "application/octet-stream"));
|
||||
String path = msg.getFile();
|
||||
String mimeType = getMimetype(path, msg.getFilemime());
|
||||
try {
|
||||
File file = new File(path);
|
||||
if( !file.exists() ) {
|
||||
@@ -958,8 +892,8 @@ public class AndroidUtilities {
|
||||
|
||||
MrMsg msg = MrMailbox.getMsg(msg_id);
|
||||
final int msg_type = msg.getType();
|
||||
String msg_file_path = msg.getParam('f', "");
|
||||
final String msg_mime = msg.getParam('m', "application/octet-stream");
|
||||
String msg_file_path = msg.getFile();
|
||||
final String msg_mime = msg.getFilemime();
|
||||
final String msg_file_name = msg.getFilename();
|
||||
final File sourceFile = new File(msg_file_path);
|
||||
if( !sourceFile.exists() ) {
|
||||
@@ -1018,7 +952,7 @@ public class AndroidUtilities {
|
||||
if (copied) {
|
||||
if ( add_to_download_manager ) {
|
||||
DownloadManager downloadManager = (DownloadManager) ApplicationLoader.applicationContext.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||
downloadManager.addCompletedDownload(destPathNFile.getName(), destPathNFile.getName(), false, getMimetype(msg_file_name, msg_mime), destPathNFile.getAbsolutePath(), destPathNFile.length(), true);
|
||||
downloadManager.addCompletedDownload(destPathNFile.getName(), destPathNFile.getName(), true, getMimetype(msg_file_name, msg_mime), destPathNFile.getAbsolutePath(), destPathNFile.length(), true);
|
||||
} else {
|
||||
addMediaToGallery(Uri.fromFile(destPathNFile));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -24,9 +24,7 @@
|
||||
package com.b44t.messenger;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.Application;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -40,11 +38,9 @@ import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Handler;
|
||||
import android.os.PowerManager;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.b44t.ui.Components.ForegroundDetector;
|
||||
import com.b44t.ui.SettingsAdvActivity;
|
||||
import com.b44t.messenger.Components.ForegroundDetector;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -59,9 +55,7 @@ public class ApplicationLoader extends Application {
|
||||
public static volatile boolean isScreenOn = false;
|
||||
public static volatile boolean mainInterfacePaused = true;
|
||||
|
||||
public static PowerManager.WakeLock backendWakeLock = null;
|
||||
public static PowerManager.WakeLock wakeupWakeLock = null;
|
||||
private static PowerManager.WakeLock stayAwakeWakeLock = null;
|
||||
public static PowerManager.WakeLock convertVideoWakeLock = null;
|
||||
|
||||
|
||||
public static int fontSize;
|
||||
@@ -72,7 +66,7 @@ public class ApplicationLoader extends Application {
|
||||
}
|
||||
|
||||
public static int getServiceMessageColor() {
|
||||
return 0x44000000; // this color is used as a background for date headlines, empty chat hints and in the drawer
|
||||
return 0x44000000; // this color is used as a background for date headlines and empty chat hints
|
||||
}
|
||||
|
||||
public static void loadWallpaper() {
|
||||
@@ -152,17 +146,20 @@ public class ApplicationLoader extends Application {
|
||||
try {
|
||||
PowerManager pm = (PowerManager) ApplicationLoader.applicationContext.getSystemService(Context.POWER_SERVICE);
|
||||
|
||||
backendWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "backendWakeLock" /*any name*/);
|
||||
// bakendWakeLock _is_ reference counted by the backend (every acquire() has a release())
|
||||
imapWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "imapWakeLock");
|
||||
imapWakeLock.setReferenceCounted(false); // if the idle-thread is killed for any reasons, it is better not to rely on reference counting
|
||||
|
||||
wakeupWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "wakeupWakeLock" /*any name*/);
|
||||
wakeupWakeLock.setReferenceCounted(false);
|
||||
smtpWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "smtpWakeLock");
|
||||
smtpWakeLock.setReferenceCounted(false); // if the idle-thread is killed for any reasons, it is better not to rely on reference counting
|
||||
|
||||
stayAwakeWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "stayAwakeWakeLock" /*any name*/);
|
||||
stayAwakeWakeLock.setReferenceCounted(false);
|
||||
convertVideoWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "convertVideoWakeLock" /*any name*/);
|
||||
convertVideoWakeLock.setReferenceCounted(false);
|
||||
|
||||
afterForgroundWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "afterForegroundWakeLock");
|
||||
afterForgroundWakeLock.setReferenceCounted(false);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("DeltaChat", "Cannot acquire wakeLock");
|
||||
Log.e("DeltaChat", "Cannot create wakeLocks");
|
||||
}
|
||||
|
||||
// create a MrMailbox object; as android stops the App by just killing it, we do never call MrMailboxUnref()
|
||||
@@ -173,7 +170,10 @@ public class ApplicationLoader extends Application {
|
||||
// start keep-alive service that restarts the app as soon it is terminated
|
||||
// (this is done by just marking the service as START_STICKY which recreates the service as
|
||||
// it goes away which also inititialized the app indirectly by calling this function)
|
||||
applicationContext.startService(new Intent(applicationContext, KeepAliveService.class));
|
||||
|
||||
/*if( getPermanentPush() ) {
|
||||
applicationContext.startService(new Intent(applicationContext, KeepAliveService.class));
|
||||
}*/
|
||||
|
||||
// init locale
|
||||
try {
|
||||
@@ -182,12 +182,16 @@ public class ApplicationLoader extends Application {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// track screen on/ff
|
||||
// track screen and network states
|
||||
try {
|
||||
final IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
final BroadcastReceiver mReceiver = new ScreenReceiver();
|
||||
applicationContext.registerReceiver(mReceiver, filter);
|
||||
|
||||
final BroadcastReceiver mNetworkStateReceiver = new NetworkStateReceiver();
|
||||
applicationContext.registerReceiver(mNetworkStateReceiver, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -207,9 +211,10 @@ public class ApplicationLoader extends Application {
|
||||
|
||||
// make sure, the notifications for the "deaddrop" dialog are muted by default
|
||||
SharedPreferences notificationPreferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
|
||||
if( notificationPreferences.getInt("notify2_"+MrChat.MR_CHAT_ID_DEADDROP, 666)==666 ) {
|
||||
if( notificationPreferences.getInt("deaddrop_initialized", 0)!=1 ) {
|
||||
SharedPreferences.Editor editor = notificationPreferences.edit();
|
||||
editor.putInt("notify2_"+MrChat.MR_CHAT_ID_DEADDROP, 2);
|
||||
editor.putInt("deaddrop_initialized", 1);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@@ -217,16 +222,22 @@ public class ApplicationLoader extends Application {
|
||||
// open() should be called before MessagesController.getInstance() as this also initilizes directories based upon getBlobdir().
|
||||
File dbfile = new File(getFilesDirFixed(), "messenger.db");
|
||||
MrMailbox.open(dbfile.getAbsolutePath());
|
||||
if( MrMailbox.isConfigured()!=0 ) {
|
||||
MrMailbox.connect();
|
||||
if( MrMailbox.isConfigured()!=0 /*&& ApplicationLoader.getPermanentPush()*/ ) {
|
||||
//ApplicationLoader.imapForeground = true;
|
||||
ApplicationLoader.startThreads();
|
||||
}
|
||||
|
||||
// create other default objects
|
||||
SharedPreferences mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
fontSize = mainPreferences.getInt("msg_font_size", SettingsAdvActivity.defMsgFontSize());
|
||||
fontSize = mainPreferences.getInt("msg_font_size", SettingsAdvFragment.defMsgFontSize());
|
||||
|
||||
ImageLoader.getInstance();
|
||||
MediaController.getInstance();
|
||||
NotificationsController.getInstance(); // force instace creation which also does some init stuff
|
||||
|
||||
if( !isScreenOn ) {
|
||||
applicationContext.startService(new Intent(applicationContext, KeepAliveService.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -262,8 +273,146 @@ public class ApplicationLoader extends Application {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void stayAwakeForAMoment()
|
||||
static private int fetchMode = -1; // 0: push, 1: poll once per minute
|
||||
|
||||
public static boolean getPermanentPush()
|
||||
{
|
||||
stayAwakeWakeLock.acquire(1*60*1000); // 1 Minute to wait for "after chat" messages, after that, we sleep most time, see wakeupWakeLock
|
||||
return true;
|
||||
/*
|
||||
if( fetchMode == -1 ) {
|
||||
SharedPreferences preferences = applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
fetchMode = preferences.getInt("fetch_mode", 1);
|
||||
}
|
||||
return fetchMode==0;
|
||||
*/
|
||||
}
|
||||
|
||||
public static void setPermanentPush(boolean permanentPush)
|
||||
{
|
||||
fetchMode = permanentPush? 0 : 1;
|
||||
SharedPreferences preferences = applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putInt("fetch_mode", fetchMode);
|
||||
editor.apply();
|
||||
|
||||
if( permanentPush ) {
|
||||
applicationContext.startService(new Intent(applicationContext, KeepAliveService.class));
|
||||
}
|
||||
else {
|
||||
applicationContext.stopService(new Intent(applicationContext, KeepAliveService.class));
|
||||
}
|
||||
}
|
||||
|
||||
private static final Object threadsCritical = new Object();
|
||||
|
||||
private static boolean imapThreadStartedVal;
|
||||
private static final Object imapThreadStartedCond = new Object();
|
||||
public static Thread imapThread = null;
|
||||
private static PowerManager.WakeLock imapWakeLock = null;
|
||||
|
||||
private static boolean smtpThreadStartedVal;
|
||||
private static final Object smtpThreadStartedCond = new Object();
|
||||
public static Thread smtpThread = null;
|
||||
private static PowerManager.WakeLock smtpWakeLock = null;
|
||||
|
||||
public static PowerManager.WakeLock afterForgroundWakeLock = null;
|
||||
|
||||
//public static boolean imapForeground = false;
|
||||
|
||||
public static void startThreads()
|
||||
{
|
||||
synchronized(threadsCritical) {
|
||||
|
||||
if (imapThread == null || !imapThread.isAlive()) {
|
||||
|
||||
synchronized (imapThreadStartedCond) {
|
||||
imapThreadStartedVal = false;
|
||||
}
|
||||
|
||||
imapThread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// raise the starting condition
|
||||
// after acquiring a wakelock so that the process is not terminated.
|
||||
// as imapWakeLock is not reference counted that would result in a wakelock-gap is not needed here.
|
||||
imapWakeLock.acquire();
|
||||
synchronized (imapThreadStartedCond) {
|
||||
imapThreadStartedVal = true;
|
||||
imapThreadStartedCond.notifyAll();
|
||||
}
|
||||
|
||||
Log.i("DeltaChat", "###################### IMAP-Thread started. ######################");
|
||||
|
||||
|
||||
while (true) {
|
||||
imapWakeLock.acquire();
|
||||
MrMailbox.performJobs();
|
||||
MrMailbox.fetch();
|
||||
imapWakeLock.release();
|
||||
MrMailbox.idle();
|
||||
}
|
||||
}
|
||||
}, "imapThread");
|
||||
imapThread.start();
|
||||
}
|
||||
|
||||
if (smtpThread == null || !smtpThread.isAlive()) {
|
||||
|
||||
synchronized (smtpThreadStartedCond) {
|
||||
smtpThreadStartedVal = false;
|
||||
}
|
||||
|
||||
smtpThread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
smtpWakeLock.acquire();
|
||||
synchronized (smtpThreadStartedCond) {
|
||||
smtpThreadStartedVal = true;
|
||||
smtpThreadStartedCond.notifyAll();
|
||||
}
|
||||
|
||||
Log.i("DeltaChat", "###################### SMTP-Thread started. ######################");
|
||||
|
||||
|
||||
while (true) {
|
||||
smtpWakeLock.acquire();
|
||||
MrMailbox.performSmtpJobs();
|
||||
smtpWakeLock.release();
|
||||
MrMailbox.performSmtpIdle();
|
||||
}
|
||||
}
|
||||
}, "smtpThread");
|
||||
smtpThread.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void waitForThreadsRunning()
|
||||
{
|
||||
try {
|
||||
synchronized( imapThreadStartedCond ) {
|
||||
while( !imapThreadStartedVal ) {
|
||||
imapThreadStartedCond.wait();
|
||||
}
|
||||
}
|
||||
|
||||
synchronized( smtpThreadStartedCond ) {
|
||||
while( !smtpThreadStartedVal ) {
|
||||
smtpThreadStartedCond.wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/*public static void scheduleStopImapThread()
|
||||
{
|
||||
//Log.i("DeltaChat", "IMAP-thread scheduled to stop.");
|
||||
|
||||
//imapForeground = false;
|
||||
//MrMailbox.interruptIdle();
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
*
|
||||
|
||||
+10
-23
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
package com.b44t.ui;
|
||||
package com.b44t.messenger;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
@@ -32,24 +32,13 @@ import android.widget.AdapterView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.FileLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.messenger.Utilities;
|
||||
import com.b44t.ui.ActionBar.ActionBar;
|
||||
import com.b44t.ui.ActionBar.BaseFragment;
|
||||
import com.b44t.ui.Adapters.BaseFragmentAdapter;
|
||||
import com.b44t.ui.Cells.AudioCell;
|
||||
import com.b44t.ui.Components.EmptyTextProgressView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.Components.PickerBottomLayout;
|
||||
import com.b44t.messenger.ActionBar.ActionBar;
|
||||
import com.b44t.messenger.ActionBar.BaseFragment;
|
||||
import com.b44t.messenger.Components.BaseFragmentAdapter;
|
||||
import com.b44t.messenger.Cells.AudioCell;
|
||||
import com.b44t.messenger.Components.EmptyTextProgressView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.PickerBottomLayout;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -96,7 +85,6 @@ public class AudioSelectActivity extends BaseFragment implements NotificationCen
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
|
||||
actionBar.setAllowOverlayTitle(true);
|
||||
actionBar.setTitle(context.getString(R.string.AttachMusic));
|
||||
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
|
||||
@Override
|
||||
@@ -225,8 +213,7 @@ public class AudioSelectActivity extends BaseFragment implements NotificationCen
|
||||
TLRPC.TL_message message = new TLRPC.TL_message();
|
||||
message.out = true;
|
||||
message.id = id;
|
||||
message.to_id = new TLRPC.TL_peerUser();
|
||||
message.to_id.user_id = message.from_id = MrContact.MR_CONTACT_ID_SELF;
|
||||
message.from_id = MrContact.MR_CONTACT_ID_SELF;
|
||||
message.date = (int) (System.currentTimeMillis() / 1000);
|
||||
message.message = "-1";
|
||||
message.attachPath = audioEntry.path;
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -38,7 +38,7 @@ public class AutoMessageHeardReceiver extends BroadcastReceiver {
|
||||
if (dialog_id == 0 || max_id == 0) {
|
||||
return;
|
||||
}
|
||||
MrMailbox.markseenChat((int)dialog_id);
|
||||
MrMailbox.marknoticedChat((int)dialog_id);
|
||||
NotificationsController.getInstance().removeSeenMessages();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -49,7 +49,7 @@ public class AutoMessageReplyReceiver extends BroadcastReceiver {
|
||||
return;
|
||||
}
|
||||
SendMessagesHelper.getInstance().sendMessageText(text.toString(), dialog_id, null);
|
||||
MrMailbox.markseenChat((int)dialog_id);
|
||||
MrMailbox.marknoticedChat((int)dialog_id);
|
||||
NotificationsController.getInstance().removeSeenMessages();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
|
||||
+10
-17
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui;
|
||||
package com.b44t.messenger;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
@@ -36,18 +36,12 @@ import android.widget.FrameLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Adapters.BaseFragmentAdapter;
|
||||
import com.b44t.ui.Cells.UserCell;
|
||||
import com.b44t.ui.ActionBar.ActionBar;
|
||||
import com.b44t.ui.ActionBar.ActionBarMenu;
|
||||
import com.b44t.ui.ActionBar.BaseFragment;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.BaseFragmentAdapter;
|
||||
import com.b44t.messenger.Cells.UserCell;
|
||||
import com.b44t.messenger.ActionBar.ActionBar;
|
||||
import com.b44t.messenger.ActionBar.ActionBarMenu;
|
||||
import com.b44t.messenger.ActionBar.BaseFragment;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class BlockedUsersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, ContactsActivity.ContactsActivityDelegate {
|
||||
|
||||
@@ -79,7 +73,6 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
|
||||
@Override
|
||||
public View createView(final Context context) {
|
||||
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
|
||||
actionBar.setAllowOverlayTitle(true);
|
||||
actionBar.setTitle(ApplicationLoader.applicationContext.getString(R.string.BlockedContacts));
|
||||
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
|
||||
@Override
|
||||
@@ -243,11 +236,11 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
if (view == null) {
|
||||
view = new UserCell(mContext, 1, 0);
|
||||
view = new UserCell(mContext,0);
|
||||
}
|
||||
if (i>=0 && i<blockedUserIds.length) {
|
||||
MrContact mrContact = MrMailbox.getContact(blockedUserIds[i]);
|
||||
((UserCell) view).setData(mrContact, 0);
|
||||
((UserCell) view).setData(mrContact);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
*
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Paint;
|
||||
@@ -38,8 +38,8 @@ import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.CheckBoxView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.CheckBoxView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class AudioCell extends FrameLayout {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -35,7 +35,7 @@ import android.view.MotionEvent;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
public class ChatActionCell extends BaseCell {
|
||||
|
||||
+121
-188
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -55,16 +55,16 @@ import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.MrPoortext;
|
||||
import com.b44t.messenger.MrLot;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.ui.Components.AvatarDrawable;
|
||||
import com.b44t.ui.Components.LinkPath;
|
||||
import com.b44t.ui.Components.SeekBar;
|
||||
import com.b44t.ui.Components.SeekBarWaveform;
|
||||
import com.b44t.ui.Components.StaticLayoutEx;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.PhotoViewer;
|
||||
import com.b44t.messenger.Components.AvatarDrawable;
|
||||
import com.b44t.messenger.Components.LinkPath;
|
||||
import com.b44t.messenger.Components.SeekBar;
|
||||
import com.b44t.messenger.Components.SeekBarWaveform;
|
||||
import com.b44t.messenger.Components.StaticLayoutEx;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.PhotoViewer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
@@ -75,6 +75,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
public interface ChatMessageCellDelegate {
|
||||
void didPressedUserAvatar(ChatMessageCell cell, TLRPC.User user);
|
||||
void didPressedSetupMessage(ChatMessageCell cell);
|
||||
void didLongPressed(ChatMessageCell cell);
|
||||
void didPressedUrl(MessageObject messageObject, ClickableSpan url, boolean longPress);
|
||||
void didPressedImage(ChatMessageCell cell);
|
||||
@@ -197,8 +198,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
private static TextPaint timePaint;
|
||||
private static TextPaint namePaint;
|
||||
private static TextPaint forwardNamePaint;
|
||||
private static TextPaint forward2NamePaint;
|
||||
|
||||
private int backgroundWidth = 100;
|
||||
|
||||
@@ -208,7 +207,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
private ImageReceiver avatarImage;
|
||||
private AvatarDrawable avatarDrawable;
|
||||
private boolean avatarPressed;
|
||||
private boolean forwardNamePressed;
|
||||
|
||||
private boolean setupmessagePressed;
|
||||
|
||||
private boolean drawNewchatButton;
|
||||
private boolean newchatPressed;
|
||||
@@ -223,26 +223,23 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
private boolean drawName;
|
||||
private boolean drawNameLayout;
|
||||
|
||||
private StaticLayout[] forwardedNameLayout = new StaticLayout[2];
|
||||
private boolean allowForwardedName;
|
||||
private static TextPaint forwardedNamePaint;
|
||||
private StaticLayout forwardedNameLayout;
|
||||
private int forwardedNameWidth;
|
||||
private boolean drawForwardedName;
|
||||
private int forwardNameX;
|
||||
private int forwardNameY;
|
||||
private float forwardNameOffsetX[] = new float[2];
|
||||
private float forwardedNameOffsetX;
|
||||
|
||||
private StaticLayout timeLayout;
|
||||
private int timeWidth;
|
||||
private int timeTextWidth;
|
||||
private int timeWidth; // includes timeEncrWidth
|
||||
private int timeEncrWidth;
|
||||
private int timeX;
|
||||
private String currentTimeString;
|
||||
private boolean drawTime = true;
|
||||
|
||||
private TLRPC.User currentUser;
|
||||
private final Object currentChat = null;
|
||||
private TLRPC.FileLocation currentPhoto;
|
||||
private String currentNameString;
|
||||
|
||||
private String currentForwardNameString;
|
||||
|
||||
private ChatMessageCellDelegate delegate;
|
||||
|
||||
@@ -287,12 +284,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
namePaint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
namePaint.setTextSize(dp(14));
|
||||
|
||||
forwardNamePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
forwardNamePaint.setTextSize(dp(14));
|
||||
|
||||
forward2NamePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
forward2NamePaint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
forward2NamePaint.setTextSize(dp(14));
|
||||
forwardedNamePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
forwardedNamePaint.setTextSize(dp(14));
|
||||
}
|
||||
avatarImage = new ImageReceiver(this);
|
||||
avatarImage.setRoundRadius(dp(21));
|
||||
@@ -524,7 +517,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
imagePressed = true;
|
||||
result = true;
|
||||
}
|
||||
} else if (currentMessageObject.type != MessageObject.MO_TYPE13_STICKER || currentMessageObject.getInputStickerSet() != null) {
|
||||
} else if (currentMessageObject.type != MessageObject.MO_TYPE13_STICKER ) {
|
||||
if (x >= photoImage.getImageX() && x <= photoImage.getImageX() + backgroundWidth && y >= photoImage.getImageY() && y <= photoImage.getImageY() + photoImage.getImageHeight()) {
|
||||
imagePressed = true;
|
||||
result = true;
|
||||
@@ -664,14 +657,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
if (isAvatarVisible && avatarImage.isInsideImage(x, y)) {
|
||||
avatarPressed = true;
|
||||
result = true;
|
||||
} else if (drawForwardedName && forwardedNameLayout[0] != null && x >= forwardNameX && x <= forwardNameX + forwardedNameWidth && y >= forwardNameY && y <= forwardNameY + dp(32)) {
|
||||
forwardNamePressed = true;
|
||||
result = true;
|
||||
} else if (drawNewchatButton && x >= newchatStartX && x <= newchatStartX + dp(40) && y >= newchatStartY && y <= newchatStartY + dp(32)) {
|
||||
newchatPressed = true;
|
||||
result = true;
|
||||
invalidate();
|
||||
} else if( currentMessageObject.messageOwner.is_setup_message && currentBackgroundDrawable.getBounds().contains((int)x, (int)y) ) {
|
||||
setupmessagePressed = true;
|
||||
result = true;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
startCheckLongPress();
|
||||
}
|
||||
@@ -696,14 +690,16 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
avatarPressed = false;
|
||||
}
|
||||
}
|
||||
} else if (forwardNamePressed) {
|
||||
} else if(setupmessagePressed) {
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
forwardNamePressed = false;
|
||||
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
forwardNamePressed = false;
|
||||
setupmessagePressed = false;
|
||||
delegate.didPressedSetupMessage(this);
|
||||
}
|
||||
else if(event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
setupmessagePressed = false;
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
if (!(x >= forwardNameX && x <= forwardNameX + forwardedNameWidth && y >= forwardNameY && y <= forwardNameY + dp(32))) {
|
||||
forwardNamePressed = false;
|
||||
if( !currentBackgroundDrawable.getBounds().contains((int)x, (int)y) ) {
|
||||
setupmessagePressed = false;
|
||||
}
|
||||
}
|
||||
} else if (newchatPressed) {
|
||||
@@ -867,7 +863,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
|
||||
private boolean isUserDataChanged() {
|
||||
if (currentMessageObject == null || currentUser == null && currentChat == null) {
|
||||
if (currentMessageObject == null || currentUser == null) {
|
||||
return false;
|
||||
}
|
||||
if (lastSendState != currentMessageObject.messageOwner.send_state) {
|
||||
@@ -878,12 +874,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
|
||||
TLRPC.User newUser = null;
|
||||
final TLRPC.Chat newChat = null;
|
||||
if (currentMessageObject.isFromUser()) {
|
||||
newUser = MrMailbox.getUser(currentMessageObject.messageOwner.from_id);
|
||||
} /*else if (currentMessageObject.messageOwner.post) {
|
||||
newChat = MessagesController.getInstance().getChat(currentMessageObject.messageOwner.to_id.channel_id);
|
||||
}*/
|
||||
}
|
||||
TLRPC.FileLocation newPhoto = null;
|
||||
|
||||
if (isAvatarVisible) {
|
||||
@@ -900,8 +893,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
if (drawName && isGroupChat && !currentMessageObject.isOutOwner()) {
|
||||
if (newUser != null) {
|
||||
newNameString = "ErrName"; // use MrContact.getName(), if really needed
|
||||
} else if (newChat != null) {
|
||||
newNameString = newChat.title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -909,10 +900,6 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
return true;
|
||||
}
|
||||
|
||||
if (drawForwardedName) {
|
||||
newNameString = currentMessageObject.getForwardedName();
|
||||
return currentForwardNameString == null && newNameString != null || currentForwardNameString != null && newNameString == null || currentForwardNameString != null && newNameString != null && !currentForwardNameString.equals(newNameString);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1046,7 +1033,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
maxWidth = maxWidth - dp(86);
|
||||
|
||||
MrPoortext pt = MrMailbox.getMsg(messageObject.getId()).getMediainfo();
|
||||
MrLot pt = MrMailbox.getMsg(messageObject.getId()).getMediainfo();
|
||||
CharSequence stringFinal = TextUtils.ellipsize(pt.getText2(), audioTitlePaint, maxWidth, TextUtils.TruncateAt.MIDDLE);
|
||||
songLayout = new StaticLayout(stringFinal, audioTitlePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
if (songLayout.getLineCount() > 0) {
|
||||
@@ -1083,12 +1070,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
int minutes = duration / 60;
|
||||
int seconds = duration - minutes * 60;
|
||||
String str = String.format("%d:%02d, %s", minutes, seconds, formatFileSize(documentAttach.size));
|
||||
if( MrMailbox.getMsg(messageObject.getId()).isIncreation()!=0 ) {
|
||||
str = ApplicationLoader.applicationContext.getString(R.string.OneMoment);
|
||||
String infoString = String.format("%d:%02d, %s", minutes, seconds, formatFileSize(documentAttach.size));
|
||||
if( MrMailbox.getMsg(messageObject.getId()).isIncreation() ) {
|
||||
infoString = ApplicationLoader.applicationContext.getString(R.string.OneMoment);
|
||||
}
|
||||
infoWidth = (int) Math.ceil(infoPaint.measureText(str));
|
||||
infoLayout = new StaticLayout(str, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
infoWidth = (int) Math.ceil(infoPaint.measureText(infoString));
|
||||
infoLayout = new StaticLayout(infoString, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1103,30 +1090,24 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
docTitleLayout = StaticLayoutEx.createStaticLayout(name, docNamePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false, TextUtils.TruncateAt.MIDDLE, maxWidth, drawPhotoImage ? 2 : 1);
|
||||
docTitleOffsetX = Integer.MIN_VALUE;
|
||||
int width;
|
||||
if (docTitleLayout != null && docTitleLayout.getLineCount() > 0) {
|
||||
int maxLineWidth = 0;
|
||||
for (int a = 0; a < docTitleLayout.getLineCount(); a++) {
|
||||
maxLineWidth = Math.max(maxLineWidth, (int) Math.ceil(docTitleLayout.getLineWidth(a)));
|
||||
docTitleOffsetX = Math.max(docTitleOffsetX, (int) Math.ceil(-docTitleLayout.getLineLeft(a)));
|
||||
}
|
||||
width = Math.min(maxWidth, maxLineWidth);
|
||||
} else {
|
||||
width = maxWidth;
|
||||
docTitleOffsetX = 0;
|
||||
}
|
||||
|
||||
String str = formatFileSize(documentAttach.size) + " " + FileLoader.getDocumentExtension(documentAttach);
|
||||
infoWidth = Math.min(maxWidth - AndroidUtilities.dp(30), (int) Math.ceil(infoPaint.measureText(str)));
|
||||
CharSequence str2 = TextUtils.ellipsize(str, infoPaint, infoWidth, TextUtils.TruncateAt.END);
|
||||
try {
|
||||
if (infoWidth < 0) {
|
||||
infoWidth = dp(10);
|
||||
}
|
||||
infoLayout = new StaticLayout(str2, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
} catch (Exception e) {
|
||||
String infoString = formatFileSize(documentAttach.size) + " " + FileLoader.getDocumentExtension(documentAttach);
|
||||
infoWidth = Math.min(maxWidth - AndroidUtilities.dp(30), (int) Math.ceil(infoPaint.measureText(infoString)));
|
||||
CharSequence str2 = TextUtils.ellipsize(infoString, infoPaint, infoWidth, TextUtils.TruncateAt.END);
|
||||
|
||||
if (infoWidth < 0) {
|
||||
infoWidth = dp(10);
|
||||
}
|
||||
infoLayout = new StaticLayout(str2, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
|
||||
if (drawPhotoImage) {
|
||||
currentPhotoObject = FileLoader.getClosestPhotoSizeWithSize(messageObject.photoThumbs, getPhotoSize());
|
||||
@@ -1208,7 +1189,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
}
|
||||
|
||||
public void setMessageObject(MessageObject messageObject) {
|
||||
public void setMessageObject(MessageObject messageObject, boolean drawNewchatButton_) {
|
||||
boolean messageChanged = currentMessageObject != messageObject || messageObject.forceUpdate;
|
||||
boolean dataChanged = currentMessageObject == messageObject && isUserDataChanged();
|
||||
if (messageChanged || dataChanged || isPhotoDataChanged(messageObject)) {
|
||||
@@ -1219,9 +1200,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
isCheckPressed = true;
|
||||
isAvatarVisible = false;
|
||||
wasLayout = false;
|
||||
drawNewchatButton = checkNeedDrawNewchatButton(messageObject);
|
||||
drawNewchatButton = drawNewchatButton_;
|
||||
currentUser = null;
|
||||
//currentChat = null;
|
||||
drawNameLayout = false;
|
||||
|
||||
resetPressedLink(-1);
|
||||
@@ -1243,7 +1223,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
drawBackground = true;
|
||||
drawName = false;
|
||||
useSeekBarWaveform = false;
|
||||
drawForwardedName = false;
|
||||
allowForwardedName = false;
|
||||
mediaBackground = false;
|
||||
availableTimeWidth = 0;
|
||||
photoImage.setNeedsQualityThumb(false);
|
||||
@@ -1258,25 +1238,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
|
||||
if (messageObject.type == MessageObject.MO_TYPE0_TEXT) {
|
||||
drawForwardedName = true;
|
||||
allowForwardedName = true;
|
||||
|
||||
int maxWidth;
|
||||
if (isTablet()) {
|
||||
if (isGroupChat && !messageObject.isOutOwner() && messageObject.isFromUser()) {
|
||||
maxWidth = getMinTabletSide() - dp(122);
|
||||
drawName = true;
|
||||
} else {
|
||||
drawName = false;
|
||||
maxWidth = getMinTabletSide() - dp(80);
|
||||
}
|
||||
if (isGroupChat && !messageObject.isOutOwner() && messageObject.isFromUser()) {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(122);
|
||||
drawName = true;
|
||||
} else {
|
||||
if (isGroupChat && !messageObject.isOutOwner() && messageObject.isFromUser()) {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(122);
|
||||
drawName = true;
|
||||
} else {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(80);
|
||||
drawName = false;
|
||||
}
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(80);
|
||||
drawName = false;
|
||||
}
|
||||
measureTime(messageObject);
|
||||
int timeMore = timeWidth + dp(6);
|
||||
@@ -1309,12 +1279,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
photoImage.setImageBitmap((Drawable) null);
|
||||
calcBackgroundWidth(maxWidth, timeMore, maxChildWidth);
|
||||
} else if (messageObject.type == MessageObject.MO_TYPE2_VOICE) {
|
||||
drawForwardedName = true;
|
||||
if (isTablet()) {
|
||||
backgroundWidth = Math.min(getMinTabletSide() - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
} else {
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
}
|
||||
allowForwardedName = true;
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
createDocumentLayout(backgroundWidth, messageObject);
|
||||
|
||||
setMessageObjectInternal(messageObject);
|
||||
@@ -1323,11 +1289,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
updateWaveform(true);
|
||||
} else if (messageObject.type == MessageObject.MO_TYPE14_MUSIC) {
|
||||
if (isTablet()) {
|
||||
backgroundWidth = Math.min(getMinTabletSide() - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
} else {
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
}
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
|
||||
createDocumentLayout(backgroundWidth, messageObject);
|
||||
|
||||
@@ -1335,7 +1297,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
totalHeight = dp(80) + namesOffset;
|
||||
} else {
|
||||
drawForwardedName = messageObject.messageOwner.fwd_from != null && messageObject.type != MessageObject.MO_TYPE13_STICKER;
|
||||
allowForwardedName = messageObject.isForwarded() && messageObject.type != MessageObject.MO_TYPE13_STICKER;
|
||||
mediaBackground = messageObject.type != MessageObject.MO_TYPE9_FILE;
|
||||
drawImageButton = false; // we do not want the image button for images
|
||||
drawPhotoImage = true;
|
||||
@@ -1352,12 +1314,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
|
||||
photoImage.setForcePreview(false);
|
||||
if (messageObject.type == MessageObject.MO_TYPE9_FILE) {
|
||||
if (isTablet()) {
|
||||
backgroundWidth = Math.min(getMinTabletSide() - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
} else {
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
}
|
||||
if (checkNeedDrawNewchatButton(messageObject)) {
|
||||
backgroundWidth = Math.min(displaySize.x - dp(isGroupChat && messageObject.isFromUser() && !messageObject.isOutOwner() ? 102 : 50), dp(270));
|
||||
if (drawNewchatButton) {
|
||||
backgroundWidth -= dp(20);
|
||||
}
|
||||
int maxWidth = backgroundWidth - dp(86 + 52);
|
||||
@@ -1395,11 +1353,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
float maxHeight;
|
||||
float maxWidth;
|
||||
if (isTablet()) {
|
||||
maxHeight = maxWidth = getMinTabletSide() * 0.4f;
|
||||
} else {
|
||||
maxHeight = maxWidth = Math.min(displaySize.x, displaySize.y) * 0.5f;
|
||||
}
|
||||
maxHeight = maxWidth = Math.min(displaySize.x, displaySize.y) * 0.5f;
|
||||
if (photoWidth == 0) {
|
||||
photoHeight = (int) maxHeight;
|
||||
photoWidth = photoHeight + dp(100);
|
||||
@@ -1431,13 +1385,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
} else {
|
||||
int maxPhotoWidth;
|
||||
if (isTablet()) {
|
||||
maxPhotoWidth = photoWidth = (int) (getMinTabletSide() * 0.7f);
|
||||
} else {
|
||||
maxPhotoWidth = photoWidth = (int) (Math.min(displaySize.x, displaySize.y) * 0.7f);
|
||||
}
|
||||
maxPhotoWidth = photoWidth = (int) (Math.min(displaySize.x, displaySize.y) * 0.7f);
|
||||
photoHeight = photoWidth + dp(100);
|
||||
if (checkNeedDrawNewchatButton(messageObject)) {
|
||||
if (drawNewchatButton) {
|
||||
maxPhotoWidth -= dp(20);
|
||||
photoWidth -= dp(20);
|
||||
}
|
||||
@@ -1604,7 +1554,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
setMessageObjectInternal(messageObject);
|
||||
|
||||
if (drawForwardedName) {
|
||||
if (allowForwardedName) {
|
||||
namesOffset += dp(5);
|
||||
} else if (drawNameLayout && messageObject.messageOwner.reply_to_msg_id == 0) {
|
||||
namesOffset += dp(7);
|
||||
@@ -1655,10 +1605,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
if (changed || !wasLayout) {
|
||||
layoutWidth = getMeasuredWidth();
|
||||
layoutHeight = getMeasuredHeight() - substractBackgroundHeight;
|
||||
if (timeTextWidth < 0) {
|
||||
timeTextWidth = dp(10);
|
||||
}
|
||||
timeLayout = new StaticLayout(currentTimeString, timePaint, timeTextWidth + dp(6), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
timeLayout = new StaticLayout(currentTimeString, timePaint, timeWidth + dp(6), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
if (!mediaBackground) {
|
||||
if (!currentMessageObject.isOutOwner()) {
|
||||
timeX = backgroundWidth - dp(9) - timeWidth + (isGroupChat && currentMessageObject.isFromUser() ? dp(48) : 0);
|
||||
@@ -1882,7 +1829,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
else if (currentMessageObject.type == MessageObject.MO_TYPE1_PHOTO || documentAttachType == DOCUMENT_ATTACH_TYPE_VIDEO) {
|
||||
if (photoImage.getVisible()) {
|
||||
if (infoLayout != null && (buttonState == BS1_CLICK_TO_PAUSE || buttonState == BS0_CLICK_TO_PLAY || buttonState == BS3_NORMAL)) {
|
||||
if (infoLayout != null /*&& (buttonState == BS1_CLICK_TO_PAUSE || buttonState == BS0_CLICK_TO_PLAY || buttonState == BS3_NORMAL)*/) {
|
||||
infoPaint.setColor(Theme.MSG_MEDIA_INFO_TEXT_COLOR);
|
||||
setDrawableBounds(Theme.timeBackgroundDrawable, photoImage.getImageX() + dp(4), photoImage.getImageY() + dp(4), infoWidth + dp(8), dp(16.5f));
|
||||
Theme.timeBackgroundDrawable.draw(canvas);
|
||||
@@ -1978,18 +1925,10 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
private int getMaxNameWidth() {
|
||||
if (documentAttachType == DOCUMENT_ATTACH_TYPE_STICKER) {
|
||||
int maxWidth;
|
||||
if (isTablet()) {
|
||||
if (isGroupChat && !currentMessageObject.isOutOwner() && currentMessageObject.isFromUser()) {
|
||||
maxWidth = getMinTabletSide() - dp(42);
|
||||
} else {
|
||||
maxWidth = getMinTabletSide();
|
||||
}
|
||||
if (isGroupChat && !currentMessageObject.isOutOwner() && currentMessageObject.isFromUser()) {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(42);
|
||||
} else {
|
||||
if (isGroupChat && !currentMessageObject.isOutOwner() && currentMessageObject.isFromUser()) {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y) - dp(42);
|
||||
} else {
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y);
|
||||
}
|
||||
maxWidth = Math.min(displaySize.x, displaySize.y);
|
||||
}
|
||||
return maxWidth - backgroundWidth - dp(57);
|
||||
}
|
||||
@@ -2088,30 +2027,24 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
}
|
||||
|
||||
private void measureTime(MessageObject messageObject) {
|
||||
currentTimeString = LocaleController.getInstance().formatterDay.format((long) (messageObject.messageOwner.date) * 1000);
|
||||
timeTextWidth = timeWidth = (int) Math.ceil(timePaint.measureText(currentTimeString));
|
||||
currentTimeString = LocaleController.getInstance().getFormatterDay().format((long) (messageObject.messageOwner.date) * 1000);
|
||||
timeWidth = (int) Math.ceil(timePaint.measureText(currentTimeString));
|
||||
timeEncrWidth = 0;
|
||||
if( messageObject.messageOwner.show_padlock) {
|
||||
timeEncrWidth = Theme.encrOutDrawable.getIntrinsicWidth();
|
||||
timeWidth += timeEncrWidth;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDrawSelectedBackground() {
|
||||
return isPressed() && isCheckPressed || !isCheckPressed && isPressed || isHighlighted;
|
||||
}
|
||||
|
||||
private boolean checkNeedDrawNewchatButton(MessageObject messageObject) {
|
||||
if( messageObject.getDialogId()== MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void setMessageObjectInternal(MessageObject messageObject) {
|
||||
|
||||
if (currentMessageObject.isFromUser()) {
|
||||
currentUser = MrMailbox.getUser(currentMessageObject.messageOwner.from_id);
|
||||
} /*else if (currentMessageObject.messageOwner.from_id < 0) {
|
||||
currentChat = MessagesController.getInstance().getChat(-currentMessageObject.messageOwner.from_id);
|
||||
} else if (currentMessageObject.messageOwner.post) {
|
||||
currentChat = MessagesController.getInstance().getChat(currentMessageObject.messageOwner.to_id.channel_id);
|
||||
}*/
|
||||
}
|
||||
|
||||
MrContact mrContact = null;
|
||||
String cname = "";
|
||||
@@ -2137,21 +2070,15 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
nameWidth = dp(100);
|
||||
}
|
||||
|
||||
if (authorName) {
|
||||
if (currentUser != null) {
|
||||
currentNameString = cname;
|
||||
} /*else if (currentChat != null) {
|
||||
currentNameString = currentChat.title;
|
||||
} */ else {
|
||||
currentNameString = "DELETED";
|
||||
}
|
||||
if (currentUser != null) {
|
||||
currentNameString = cname;
|
||||
} else {
|
||||
currentNameString = "";
|
||||
currentNameString = "DELETED";
|
||||
}
|
||||
CharSequence nameStringFinal = TextUtils.ellipsize(currentNameString.replace('\n', ' '), namePaint, nameWidth, TextUtils.TruncateAt.END);
|
||||
try {
|
||||
nameLayout = new StaticLayout(nameStringFinal, namePaint, nameWidth + dp(2), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
if (nameLayout != null && nameLayout.getLineCount() > 0) {
|
||||
if (nameLayout.getLineCount() > 0) {
|
||||
nameWidth = (int) Math.ceil(nameLayout.getLineWidth(0));
|
||||
if (messageObject.type != MessageObject.MO_TYPE13_STICKER) {
|
||||
namesOffset += dp(19);
|
||||
@@ -2172,28 +2099,18 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
nameWidth = 0;
|
||||
}
|
||||
|
||||
currentForwardNameString = null;
|
||||
forwardedNameLayout[0] = null;
|
||||
forwardedNameLayout[1] = null;
|
||||
forwardedNameLayout = null;
|
||||
forwardedNameWidth = 0;
|
||||
if( drawForwardedName && messageObject.isForwarded() && messageObject.messageOwner.fwd_from!=null )
|
||||
if( allowForwardedName && messageObject.isForwarded() )
|
||||
{
|
||||
currentForwardNameString = messageObject.messageOwner.fwd_from.m_name;
|
||||
|
||||
forwardedNameWidth = getMaxNameWidth();
|
||||
int fromWidth = (int) Math.ceil(forwardNamePaint.measureText(ApplicationLoader.applicationContext.getString(R.string.From) + " "));
|
||||
CharSequence name = TextUtils.ellipsize(currentForwardNameString.replace('\n', ' '), forward2NamePaint, forwardedNameWidth - fromWidth, TextUtils.TruncateAt.END);
|
||||
CharSequence lastLine;
|
||||
lastLine = replaceTags(String.format("%s <b>%s</b>", ApplicationLoader.applicationContext.getString(R.string.From), name));
|
||||
lastLine = TextUtils.ellipsize(lastLine, forwardNamePaint, forwardedNameWidth, TextUtils.TruncateAt.END);
|
||||
try {
|
||||
forwardedNameLayout[1] = new StaticLayout(lastLine, forwardNamePaint, forwardedNameWidth + dp(2), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
lastLine = TextUtils.ellipsize(replaceTags(ApplicationLoader.applicationContext.getString(R.string.ForwardedMessage)), forwardNamePaint, forwardedNameWidth, TextUtils.TruncateAt.END);
|
||||
forwardedNameLayout[0] = new StaticLayout(lastLine, forwardNamePaint, forwardedNameWidth + dp(2), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
forwardedNameWidth = Math.max((int) Math.ceil(forwardedNameLayout[0].getLineWidth(0)), (int) Math.ceil(forwardedNameLayout[1].getLineWidth(0)));
|
||||
forwardNameOffsetX[0] = forwardedNameLayout[0].getLineLeft(0);
|
||||
forwardNameOffsetX[1] = forwardedNameLayout[1].getLineLeft(0);
|
||||
namesOffset += dp(36);
|
||||
lastLine = TextUtils.ellipsize(replaceTags(ApplicationLoader.applicationContext.getString(R.string.ForwardedMessage)), forwardedNamePaint, forwardedNameWidth, TextUtils.TruncateAt.END);
|
||||
forwardedNameLayout = new StaticLayout(lastLine, forwardedNamePaint, forwardedNameWidth + dp(2), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||
forwardedNameWidth = (int) Math.ceil(forwardedNameLayout.getLineWidth(0));
|
||||
forwardedNameOffsetX = forwardedNameLayout.getLineLeft(0);
|
||||
namesOffset += dp(18);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
@@ -2299,24 +2216,23 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if (drawForwardedName && forwardedNameLayout[0] != null && forwardedNameLayout[1] != null) {
|
||||
forwardNameY = dp(10 + (drawNameLayout ? 19 : 0));
|
||||
forwardNamePaint.setColor(Theme.MSG_IN_TIME_N_FWD_TEXT_COLOR);
|
||||
if (allowForwardedName && forwardedNameLayout != null ) {
|
||||
int forwardedNameX = 0;
|
||||
int forwardedNameY = dp(10 + (drawNameLayout ? 19 : 0));
|
||||
forwardedNamePaint.setColor(Theme.MSG_IN_TIME_N_FWD_TEXT_COLOR);
|
||||
if (currentMessageObject.isOutOwner()) {
|
||||
forwardNameX = currentBackgroundDrawable.getBounds().left + dp(11);
|
||||
forwardedNameX = currentBackgroundDrawable.getBounds().left + dp(11);
|
||||
} else {
|
||||
if (mediaBackground) {
|
||||
forwardNameX = currentBackgroundDrawable.getBounds().left + dp(11);
|
||||
forwardedNameX = currentBackgroundDrawable.getBounds().left + dp(11);
|
||||
} else {
|
||||
forwardNameX = currentBackgroundDrawable.getBounds().left + dp(17);
|
||||
forwardedNameX = currentBackgroundDrawable.getBounds().left + dp(17);
|
||||
}
|
||||
}
|
||||
for (int a = 0; a < 2; a++) {
|
||||
canvas.save();
|
||||
canvas.translate(forwardNameX - forwardNameOffsetX[a], forwardNameY + dp(16) * a);
|
||||
forwardedNameLayout[a].draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
canvas.save();
|
||||
canvas.translate(forwardedNameX - forwardedNameOffsetX, forwardedNameY);
|
||||
forwardedNameLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if (drawTime || !mediaBackground) {
|
||||
@@ -2333,19 +2249,36 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
|
||||
int additionalX = 0;
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(timeX + additionalX, layoutHeight - dp(11.3f) - timeLayout.getHeight());
|
||||
canvas.translate(timeX + additionalX + timeEncrWidth, layoutHeight - dp(11.3f) - timeLayout.getHeight());
|
||||
timeLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
} else {
|
||||
int additionalX = 0;
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(timeX + additionalX, layoutHeight - dp(6.5f) - timeLayout.getHeight());
|
||||
canvas.translate(timeX + additionalX + timeEncrWidth, layoutHeight - dp(6.5f) - timeLayout.getHeight());
|
||||
timeLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
//canvas.drawRect(timeX, layoutHeight - AndroidUtilities.dp(6.5f) - timeLayout.getHeight(), timeX + availableTimeWidth, layoutHeight - AndroidUtilities.dp(4.5f) - timeLayout.getHeight(), timePaint);
|
||||
}
|
||||
|
||||
// draw encryption icon left of clock
|
||||
if( timeEncrWidth>0 ) {
|
||||
if (!mediaBackground) {
|
||||
if (currentMessageObject.isOutOwner()) {
|
||||
setDrawableBounds(Theme.encrOutDrawable, timeX, layoutHeight - dp(8.5f) - Theme.encrOutDrawable.getIntrinsicHeight());
|
||||
Theme.encrOutDrawable.draw(canvas);
|
||||
} else {
|
||||
setDrawableBounds(Theme.encrInDrawable, timeX, layoutHeight - dp(8.5f) - Theme.encrInDrawable.getIntrinsicHeight());
|
||||
Theme.encrInDrawable.draw(canvas);
|
||||
}
|
||||
} else {
|
||||
setDrawableBounds(Theme.encrMediaDrawable, timeX, layoutHeight - dp(13.2f) - Theme.encrMediaDrawable.getIntrinsicHeight());
|
||||
Theme.encrMediaDrawable.draw(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
// draw checkmarks right of clock
|
||||
if (currentMessageObject.isOutOwner()) {
|
||||
boolean drawCheck1 = false;
|
||||
boolean drawCheck2 = false;
|
||||
+4
-5
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,21 +21,20 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
public class ChatUnreadCell extends FrameLayout {
|
||||
|
||||
+207
-252
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -39,26 +39,24 @@ import android.text.style.ForegroundColorSpan;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.ContactsController;
|
||||
import com.b44t.messenger.EmojiInputView;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrLot;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.MrMsg;
|
||||
import com.b44t.messenger.MrPoortext;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.messenger.Emoji;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.ImageReceiver;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.Components.AvatarDrawable;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.Components.AvatarDrawable;
|
||||
|
||||
|
||||
public class DialogCell extends BaseCell {
|
||||
public class ChatlistCell extends BaseCell {
|
||||
|
||||
private static TextPaint namePaint;
|
||||
private static TextPaint messagePaint;
|
||||
private static TextPaint messagePrintingPaint;
|
||||
private static TextPaint timePaint;
|
||||
private static TextPaint countPaint;
|
||||
|
||||
@@ -67,36 +65,29 @@ public class DialogCell extends BaseCell {
|
||||
private static Drawable clockDrawable;
|
||||
private static Drawable errorDrawable;
|
||||
private static Drawable countDrawable;
|
||||
private static Drawable countDrawableGrey;
|
||||
private static Drawable groupDrawable;
|
||||
private static Drawable muteDrawable;
|
||||
private static Drawable verifiedDrawable;
|
||||
private static Drawable closeDrawable;
|
||||
|
||||
private static Paint linePaint;
|
||||
private static Paint backPaint;
|
||||
|
||||
private long currentDialogId;
|
||||
private final boolean isDialogCell = true; // if it is no dialog cell, it is a search cell ...
|
||||
private long currentChatId;
|
||||
private int unreadCount;
|
||||
private int lastSendState;
|
||||
private boolean dialogMuted;
|
||||
private final MessageObject message = null;
|
||||
private int index;
|
||||
private boolean chatMuted;
|
||||
private boolean chatVerified;
|
||||
|
||||
private ImageReceiver avatarImage;
|
||||
private AvatarDrawable avatarDrawable;
|
||||
|
||||
private final Object user = null;
|
||||
private final Object chat = null;
|
||||
|
||||
public boolean useSeparator = false;
|
||||
|
||||
private int nameLeft;
|
||||
private StaticLayout nameLayout;
|
||||
private boolean drawNameGroup;
|
||||
private int nameMuteLeft;
|
||||
private boolean drawGroupIcon;
|
||||
private int nameVerifiedLeft;
|
||||
private int nameLockLeft;
|
||||
private int nameLockTop;
|
||||
private int muteLeft;
|
||||
|
||||
private int timeLeft;
|
||||
private int timeTop = AndroidUtilities.dp(17);
|
||||
@@ -114,7 +105,7 @@ public class DialogCell extends BaseCell {
|
||||
private StaticLayout messageLayout;
|
||||
|
||||
private boolean drawError;
|
||||
private int errorTop = AndroidUtilities.dp(39);
|
||||
private int errorTop = AndroidUtilities.dp(42);
|
||||
private int errorLeft;
|
||||
|
||||
private boolean drawCount;
|
||||
@@ -123,39 +114,35 @@ public class DialogCell extends BaseCell {
|
||||
private int countWidth;
|
||||
private StaticLayout countLayout;
|
||||
|
||||
private boolean drawVerified;
|
||||
private boolean drawFlag; // draw a flag as eg. "Archived" below the time
|
||||
private int flagLeft;
|
||||
private int flagWidth;
|
||||
private StaticLayout flagLayout;
|
||||
|
||||
private int avatarLeft;
|
||||
private int avatarTop = AndroidUtilities.dp(10);
|
||||
|
||||
private boolean isSelected;
|
||||
private int avatarWH = AndroidUtilities.dp(52);
|
||||
|
||||
private MrChat m_mrChat = new MrChat(0);
|
||||
private MrPoortext m_summary = new MrPoortext(0);
|
||||
private MrLot m_summary = new MrLot(0);
|
||||
private boolean m_showUnreadCount;
|
||||
|
||||
public DialogCell(Context context) {
|
||||
public ChatlistCell(Context context) {
|
||||
super(context);
|
||||
|
||||
if (namePaint == null) {
|
||||
namePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
namePaint.setTextSize(AndroidUtilities.dp(17));
|
||||
namePaint.setColor(Theme.DIALOGS_TITLE_TEXT_COLOR);
|
||||
namePaint.setColor(Theme.CHATLIST_TITLE_TEXT_COLOR);
|
||||
|
||||
messagePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
messagePaint.setTextSize(AndroidUtilities.dp(16));
|
||||
messagePaint.setColor(Theme.DIALOGS_MESSAGE_TEXT_COLOR);
|
||||
messagePaint.linkColor = Theme.DIALOGS_MESSAGE_TEXT_COLOR;
|
||||
messagePaint.setColor(Theme.CHATLIST_MESSAGE_TEXT_COLOR);
|
||||
messagePaint.linkColor = Theme.CHATLIST_MESSAGE_TEXT_COLOR;
|
||||
|
||||
linePaint = new Paint();
|
||||
linePaint.setColor(0xffdcdcdc);
|
||||
|
||||
backPaint = new Paint();
|
||||
backPaint.setColor(0x0f000000);
|
||||
|
||||
messagePrintingPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
messagePrintingPaint.setTextSize(AndroidUtilities.dp(16));
|
||||
messagePrintingPaint.setColor(Theme.DIALOGS_PRINTING_TEXT_COLOR);
|
||||
|
||||
timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG);
|
||||
timePaint.setTextSize(AndroidUtilities.dp(13));
|
||||
timePaint.setColor(0xff999999);
|
||||
@@ -168,37 +155,35 @@ public class DialogCell extends BaseCell {
|
||||
checkDrawable = getResources().getDrawable(R.drawable.dialogs_check);
|
||||
halfCheckDrawable = getResources().getDrawable(R.drawable.dialogs_halfcheck);
|
||||
clockDrawable = getResources().getDrawable(R.drawable.msg_clock);
|
||||
errorDrawable = getResources().getDrawable(R.drawable.dialogs_warning);
|
||||
errorDrawable = getResources().getDrawable(R.drawable.msg_warning);
|
||||
countDrawable = getResources().getDrawable(R.drawable.dialogs_badge);
|
||||
countDrawableGrey = getResources().getDrawable(R.drawable.dialogs_badge2);
|
||||
groupDrawable = getResources().getDrawable(R.drawable.list_group);
|
||||
muteDrawable = getResources().getDrawable(R.drawable.mute_grey);
|
||||
verifiedDrawable = getResources().getDrawable(R.drawable.check_list);
|
||||
verifiedDrawable = getResources().getDrawable(R.drawable.verified);
|
||||
closeDrawable = getResources().getDrawable(R.drawable.ic_dismiss_deaddrop);
|
||||
}
|
||||
|
||||
setBackgroundResource(R.drawable.list_selector);
|
||||
|
||||
avatarImage = new ImageReceiver(this);
|
||||
avatarImage.setRoundRadius(AndroidUtilities.dp(26));
|
||||
avatarDrawable = new AvatarDrawable();
|
||||
}
|
||||
|
||||
public void setDialog(MrChat mrChat, MrPoortext mrSummary, int i, boolean showUnreadCount) { // called for the chats overview
|
||||
|
||||
public void setChat(MrChat mrChat, MrLot mrSummary, int i, boolean showUnreadCount) {
|
||||
m_mrChat = mrChat;
|
||||
m_summary = mrSummary;
|
||||
m_showUnreadCount = showUnreadCount;
|
||||
|
||||
currentDialogId = mrChat.getId();
|
||||
index = i;
|
||||
currentChatId = mrChat.getId();
|
||||
|
||||
if(currentChatId==MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
setBackgroundColor(Theme.CHATLIST_DEADDROP_BACKGROUND_COLOR);
|
||||
}
|
||||
else {
|
||||
setBackgroundResource(R.drawable.list_selector);
|
||||
}
|
||||
|
||||
update(0);
|
||||
}
|
||||
|
||||
public long getDialogId() {
|
||||
return currentDialogId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
@@ -218,7 +203,7 @@ public class DialogCell extends BaseCell {
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
if (currentDialogId == 0) {
|
||||
if (currentChatId == 0) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
return;
|
||||
}
|
||||
@@ -227,6 +212,7 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
static public boolean deaddropClosePressed;
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (Build.VERSION.SDK_INT >= 21 && getBackground() != null) {
|
||||
@@ -234,108 +220,86 @@ public class DialogCell extends BaseCell {
|
||||
getBackground().setHotspot(event.getX(), event.getY());
|
||||
}
|
||||
}
|
||||
|
||||
if( currentChatId==MrChat.MR_CHAT_ID_DEADDROP ) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
float x = event.getX();
|
||||
deaddropClosePressed = (x < avatarLeft + avatarWH);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
public void buildLayout() {
|
||||
String nameString = "";
|
||||
String timeString = "";
|
||||
String countString = null;
|
||||
CharSequence messageString = "";
|
||||
//CharSequence printingString = null;
|
||||
/* EDIT BY MR -- we currently do not support stuff as "ist just typing", "uploads an images" etc.
|
||||
if (isDialogCell) {
|
||||
printingString = MessagesController.getInstance().printingStrings.get(currentDialogId);
|
||||
}
|
||||
*/
|
||||
TextPaint currentNamePaint = namePaint;
|
||||
TextPaint currentMessagePaint = messagePaint;
|
||||
boolean checkMessage = true;
|
||||
|
||||
drawNameGroup = false;
|
||||
//drawNameBroadcast = false;
|
||||
//drawNameLock = false;
|
||||
//drawNameBot = false;
|
||||
drawVerified = false;
|
||||
drawGroupIcon = false;
|
||||
|
||||
{
|
||||
if (m_mrChat.getType()==MrChat.MR_CHAT_GROUP) { // EDIT BY MR
|
||||
//if (chat.id < 0 || ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||
// drawNameBroadcast = true;
|
||||
// nameLockTop = AndroidUtilities.dp(16.5f);
|
||||
//} else {
|
||||
drawNameGroup = true;
|
||||
nameLockTop = AndroidUtilities.dp(17.5f);
|
||||
//}
|
||||
//drawVerified = chat.verified; -- /EDIT BY MR
|
||||
if (m_mrChat.isGroup() && currentChatId!=MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
drawGroupIcon = true;
|
||||
nameLockTop = AndroidUtilities.dp(17.5f);
|
||||
|
||||
if (!LocaleController.isRTL) {
|
||||
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + (groupDrawable.getIntrinsicWidth());
|
||||
} else {
|
||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - (groupDrawable.getIntrinsicWidth());
|
||||
nameLeft = AndroidUtilities.dp(14);
|
||||
}
|
||||
if (!LocaleController.isRTL) {
|
||||
nameLockLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline + 4) + (groupDrawable.getIntrinsicWidth());
|
||||
} else {
|
||||
if (!LocaleController.isRTL) {
|
||||
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||
} else {
|
||||
nameLeft = AndroidUtilities.dp(14);
|
||||
}
|
||||
nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline) - (groupDrawable.getIntrinsicWidth());
|
||||
nameLeft = AndroidUtilities.dp(14);
|
||||
}
|
||||
} else {
|
||||
if (!LocaleController.isRTL) {
|
||||
nameLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||
} else {
|
||||
nameLeft = AndroidUtilities.dp(14);
|
||||
}
|
||||
}
|
||||
|
||||
String mess = m_summary.getText2();
|
||||
if (mess.length() > 150) {
|
||||
mess = mess.substring(0, 150);
|
||||
}
|
||||
String title = m_summary.getText1();
|
||||
if( !title.isEmpty() )
|
||||
{
|
||||
checkMessage = false;
|
||||
String mess = m_summary.getText2();
|
||||
if (mess.length() > 150) {
|
||||
mess = mess.substring(0, 150);
|
||||
}
|
||||
String title = m_summary.getText1();
|
||||
if( !title.isEmpty() )
|
||||
{
|
||||
int title_meaning = m_summary.getText1Meaning();
|
||||
int title_color = Theme.DIALOGS_NAME_TEXT_COLOR;
|
||||
switch( title_meaning ) {
|
||||
case MrPoortext.MR_TEXT1_SELF: title_color = Theme.DIALOGS_SELF_TEXT_COLOR; break;
|
||||
case MrPoortext.MR_TEXT1_DRAFT: title_color = Theme.DIALOGS_DRAFT_TEXT_COLOR; break;
|
||||
}
|
||||
SpannableStringBuilder stringBuilder = SpannableStringBuilder.valueOf(String.format("%s: %s", title, mess));
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(title_color), 0, title.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
messageString = Emoji.replaceEmoji(stringBuilder, messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageString = mess;
|
||||
}
|
||||
|
||||
long timestmp =m_summary.getTimestamp();
|
||||
if( timestmp!=0 ) {
|
||||
timeString = LocaleController.stringForMessageListDate(timestmp);
|
||||
}
|
||||
else {
|
||||
timeString = "";
|
||||
}
|
||||
|
||||
drawCheck1 = false;
|
||||
drawCheck2 = false;
|
||||
drawClock = false;
|
||||
drawCount = false;
|
||||
drawError = false;
|
||||
switch( m_summary.getState() ) {
|
||||
case MrMsg.MR_OUT_ERROR: drawError = true; break;
|
||||
case MrMsg.MR_OUT_PENDING: drawClock = true; break;
|
||||
case MrMsg.MR_OUT_DELIVERED: drawCheck2 = true; break;
|
||||
case MrMsg.MR_OUT_READ: drawCheck1 = true; drawCheck2 = true; break;
|
||||
}
|
||||
drawVerified = m_mrChat.isEncrypted()!=0; // we use the "verified" check as an icon for "encryted" and "verified"
|
||||
int title_meaning = m_summary.getText1Meaning();
|
||||
int title_color = Theme.CHATLIST_NAME_TEXT_COLOR;
|
||||
switch( title_meaning ) {
|
||||
case MrLot.MR_TEXT1_SELF: title_color = Theme.CHATLIST_SELF_TEXT_COLOR; break;
|
||||
case MrLot.MR_TEXT1_DRAFT: title_color = Theme.CHATLIST_DRAFT_TEXT_COLOR; break;
|
||||
}
|
||||
SpannableStringBuilder stringBuilder = SpannableStringBuilder.valueOf(String.format("%s: %s", title, mess));
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(title_color), 0, title.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
messageString = EmojiInputView.replaceEmoji(stringBuilder, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageString = mess;
|
||||
}
|
||||
|
||||
if (unreadCount != 0) {
|
||||
drawCount = true;
|
||||
countString = String.format("%d", unreadCount);
|
||||
} else {
|
||||
drawCount = false;
|
||||
long timestmp =m_summary.getTimestamp();
|
||||
if( timestmp!=0 ) {
|
||||
timeString = LocaleController.dateForChatlist(timestmp);
|
||||
}
|
||||
else {
|
||||
timeString = "";
|
||||
}
|
||||
|
||||
drawCheck1 = false;
|
||||
drawCheck2 = false;
|
||||
drawClock = false;
|
||||
drawCount = false;
|
||||
drawFlag = false;
|
||||
drawError = false;
|
||||
switch( m_summary.getState() ) {
|
||||
case MrMsg.MR_OUT_ERROR: drawError = true; break;
|
||||
case MrMsg.MR_OUT_PENDING: drawClock = true; break;
|
||||
case MrMsg.MR_OUT_DELIVERED: drawCheck2 = true; break;
|
||||
case MrMsg.MR_OUT_MDN_RCVD: drawCheck1 = true; drawCheck2 = true; break;
|
||||
}
|
||||
|
||||
int timeWidth = (int) Math.ceil(timePaint.measureText(timeString));
|
||||
@@ -357,7 +321,7 @@ public class DialogCell extends BaseCell {
|
||||
nameLeft += timeWidth;
|
||||
}
|
||||
|
||||
if (drawNameGroup) {
|
||||
if (drawGroupIcon) {
|
||||
nameWidth -= AndroidUtilities.dp(4) + groupDrawable.getIntrinsicWidth();
|
||||
}
|
||||
|
||||
@@ -393,13 +357,7 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogMuted && !drawVerified) {
|
||||
int w = AndroidUtilities.dp(6) + muteDrawable.getIntrinsicWidth();
|
||||
nameWidth -= w;
|
||||
if (LocaleController.isRTL) {
|
||||
nameLeft += w;
|
||||
}
|
||||
} else if (drawVerified) {
|
||||
if (chatVerified) {
|
||||
int w = AndroidUtilities.dp(6) + verifiedDrawable.getIntrinsicWidth();
|
||||
nameWidth -= w;
|
||||
if (LocaleController.isRTL) {
|
||||
@@ -407,6 +365,7 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
// build name
|
||||
nameWidth = Math.max(AndroidUtilities.dp(12), nameWidth);
|
||||
CharSequence nameStringFinal = TextUtils.ellipsize(nameString.replace('\n', ' '), currentNamePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
||||
try {
|
||||
@@ -415,26 +374,57 @@ public class DialogCell extends BaseCell {
|
||||
|
||||
}
|
||||
|
||||
// build avatar
|
||||
int messageWidth = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline + 16);
|
||||
int avatarLeft;
|
||||
if (!LocaleController.isRTL) {
|
||||
messageLeft = AndroidUtilities.dp(AndroidUtilities.leftBaseline);
|
||||
avatarLeft = AndroidUtilities.dp(AndroidUtilities.isTablet() ? 13 : 9);
|
||||
avatarLeft = AndroidUtilities.dp(9);
|
||||
} else {
|
||||
messageLeft = AndroidUtilities.dp(16);
|
||||
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.isTablet() ? 65 : 61);
|
||||
avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(61);
|
||||
}
|
||||
avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(52), AndroidUtilities.dp(52));
|
||||
|
||||
if( currentChatId==MrChat.MR_CHAT_ID_DEADDROP ) {
|
||||
|
||||
}
|
||||
else {
|
||||
avatarImage.setImageCoords(avatarLeft, avatarTop, avatarWH, avatarWH);
|
||||
}
|
||||
|
||||
// build counter
|
||||
if (drawError) {
|
||||
int w = errorDrawable.getIntrinsicWidth() + AndroidUtilities.dp(8);
|
||||
messageWidth -= w;
|
||||
if (!LocaleController.isRTL) {
|
||||
errorLeft = getMeasuredWidth() - errorDrawable.getIntrinsicWidth() - AndroidUtilities.dp(11);
|
||||
errorLeft = getMeasuredWidth() - errorDrawable.getIntrinsicWidth() - AndroidUtilities.dp(16);
|
||||
} else {
|
||||
errorLeft = AndroidUtilities.dp(11);
|
||||
errorLeft = AndroidUtilities.dp(16);
|
||||
messageLeft += w;
|
||||
}
|
||||
} else if (countString != null) {
|
||||
} else if(m_mrChat.getArchived()!=0 || currentChatId==MrChat.MR_CHAT_ID_ARCHIVED_LINK ) {
|
||||
String str;
|
||||
TextPaint strPaint;
|
||||
if( currentChatId==MrChat.MR_CHAT_ID_ARCHIVED_LINK ) {
|
||||
str = m_mrChat.getName();
|
||||
strPaint = messagePaint;
|
||||
}
|
||||
else {
|
||||
str = ApplicationLoader.applicationContext.getString(R.string.Archived);
|
||||
strPaint = timePaint;
|
||||
}
|
||||
|
||||
flagWidth = Math.max(AndroidUtilities.dp(12), (int)Math.ceil(strPaint.measureText(str)));
|
||||
flagLayout = new StaticLayout(str, strPaint, flagWidth, Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, false);
|
||||
int w = flagWidth + AndroidUtilities.dp(15);
|
||||
if (!LocaleController.isRTL) {
|
||||
messageWidth -= w;
|
||||
flagLeft = getMeasuredWidth() - flagWidth - AndroidUtilities.dp(15);
|
||||
} else {
|
||||
flagLeft = AndroidUtilities.dp(15);
|
||||
}
|
||||
drawFlag = true;
|
||||
} else if (unreadCount != 0 && currentChatId!=MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
String countString = String.format("%d", unreadCount);
|
||||
countWidth = Math.max(AndroidUtilities.dp(12), (int)Math.ceil(countPaint.measureText(countString)));
|
||||
countLayout = new StaticLayout(countString, countPaint, countWidth, Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, false);
|
||||
int w = countWidth + AndroidUtilities.dp(18);
|
||||
@@ -446,21 +436,17 @@ public class DialogCell extends BaseCell {
|
||||
messageLeft += w;
|
||||
}
|
||||
drawCount = true;
|
||||
} else {
|
||||
drawCount = false;
|
||||
}
|
||||
|
||||
if (checkMessage) {
|
||||
if (messageString == null) {
|
||||
messageString = "";
|
||||
if (chatMuted) {
|
||||
muteLeft = messageLeft;
|
||||
int w = AndroidUtilities.dp(6) + muteDrawable.getIntrinsicWidth();
|
||||
messageWidth -= w;
|
||||
if (!LocaleController.isRTL) {
|
||||
messageLeft += w;
|
||||
}
|
||||
String mess = messageString.toString();
|
||||
if (mess.length() > 150) {
|
||||
mess = mess.substring(0, 150);
|
||||
}
|
||||
mess = mess.replace('\n', ' ');
|
||||
messageString = Emoji.replaceEmoji(mess, messagePaint.getFontMetricsInt(), AndroidUtilities.dp(17), false);
|
||||
}
|
||||
|
||||
messageWidth = Math.max(AndroidUtilities.dp(12), messageWidth);
|
||||
CharSequence messageStringFinal = TextUtils.ellipsize(messageString, currentMessagePaint, messageWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
||||
try {
|
||||
@@ -475,10 +461,8 @@ public class DialogCell extends BaseCell {
|
||||
if (nameLayout != null && nameLayout.getLineCount() > 0) {
|
||||
left = nameLayout.getLineLeft(0);
|
||||
widthpx = Math.ceil(nameLayout.getLineWidth(0));
|
||||
if (dialogMuted && !drawVerified) {
|
||||
nameMuteLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - muteDrawable.getIntrinsicWidth());
|
||||
} else if (drawVerified) {
|
||||
nameMuteLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - verifiedDrawable.getIntrinsicWidth());
|
||||
if (chatVerified) {
|
||||
nameVerifiedLeft = (int) (nameLeft + (nameWidth - widthpx) - AndroidUtilities.dp(6) - muteDrawable.getIntrinsicWidth());
|
||||
}
|
||||
if (left == 0) {
|
||||
if (widthpx < nameWidth) {
|
||||
@@ -504,8 +488,8 @@ public class DialogCell extends BaseCell {
|
||||
nameLeft -= (nameWidth - widthpx);
|
||||
}
|
||||
}
|
||||
if (dialogMuted || drawVerified) {
|
||||
nameMuteLeft = (int) (nameLeft + left + AndroidUtilities.dp(6));
|
||||
if (chatVerified) {
|
||||
nameVerifiedLeft = (int) (nameLeft + left + AndroidUtilities.dp(6));
|
||||
}
|
||||
}
|
||||
if (messageLayout != null && messageLayout.getLineCount() > 0) {
|
||||
@@ -520,60 +504,24 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDialogSelected(boolean value) {
|
||||
if (isSelected != value) {
|
||||
invalidate();
|
||||
}
|
||||
isSelected = value;
|
||||
}
|
||||
|
||||
public void checkCurrentDialogIndex() {
|
||||
if (index < MrMailbox.m_currChatlist.getCnt()) { // EDIT BY MR - was: index < getDialogsArray().size()
|
||||
TLRPC.TL_dialog dialog = MrMailbox.m_currChatlist.get_TLRPC_TL_dialog(index); // EDIT BY MR - was: getDialogsArray().get(index);
|
||||
final MessageObject newMessageObject = null;
|
||||
if (currentDialogId != dialog.id ||
|
||||
message != null && message.getId() != dialog.top_message ||
|
||||
unreadCount != dialog.unread_count ||
|
||||
message != newMessageObject ||
|
||||
message == null && newMessageObject != null ) {
|
||||
currentDialogId = dialog.id;
|
||||
update(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void update(int mask) {
|
||||
if( m_showUnreadCount ) {
|
||||
unreadCount = m_mrChat.getUnseenCount();
|
||||
unreadCount = MrMailbox.getFreshMsgCount(m_mrChat.getId());
|
||||
}
|
||||
|
||||
if (mask != 0) {
|
||||
boolean continueUpdate = false;
|
||||
if (!continueUpdate && (mask & MrMailbox.UPDATE_MASK_AVATAR) != 0) {
|
||||
if (chat == null) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
continueUpdate = true;
|
||||
}
|
||||
if (!continueUpdate && (mask & MrMailbox.UPDATE_MASK_NAME) != 0) {
|
||||
if (chat == null) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
continueUpdate = true;
|
||||
}
|
||||
if (!continueUpdate && (mask & MrMailbox.UPDATE_MASK_CHAT_AVATAR) != 0) {
|
||||
if (user == null) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
continueUpdate = true;
|
||||
}
|
||||
if (!continueUpdate && (mask & MrMailbox.UPDATE_MASK_CHAT_NAME) != 0) {
|
||||
if (user == null) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
}
|
||||
if (!continueUpdate && (mask & MrMailbox.UPDATE_MASK_SEND_STATE) != 0) {
|
||||
if (message != null && lastSendState != message.messageOwner.send_state) {
|
||||
lastSendState = message.messageOwner.send_state;
|
||||
continueUpdate = true;
|
||||
}
|
||||
continueUpdate = true;
|
||||
}
|
||||
|
||||
if (!continueUpdate) {
|
||||
@@ -581,25 +529,23 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
dialogMuted = isDialogCell && MrMailbox.isDialogMuted(currentDialogId);
|
||||
//user = null;
|
||||
//chat = null;
|
||||
|
||||
/*int lower_id = (int)currentDialogId;
|
||||
int high_id = (int)(currentDialogId >> 32);
|
||||
if (lower_id != 0) {
|
||||
if (high_id == 1) {
|
||||
chat = MessagesController.getInstance().getChat(lower_id);
|
||||
} else {
|
||||
if (lower_id < 0) {
|
||||
chat = MessagesController.getInstance().getChat(-lower_id);
|
||||
} else {
|
||||
user = MessagesController.getInstance().getUser(lower_id);
|
||||
}
|
||||
|
||||
if( currentChatId == MrChat.MR_CHAT_ID_DEADDROP ) {
|
||||
chatMuted = false; // never draw mute icon, the deaddrop is always muted
|
||||
chatVerified = false;
|
||||
}
|
||||
else {
|
||||
chatMuted = MrMailbox.isDialogMuted(currentChatId);
|
||||
ContactsController.setupAvatar(this, avatarImage, new AvatarDrawable(), null, m_mrChat);
|
||||
chatVerified = m_mrChat.isVerified();
|
||||
|
||||
// can be deleted if this gets out-of-labs
|
||||
if( chatVerified && MrMailbox.getConfigInt("qr_enabled", 0)==0 ) {
|
||||
chatVerified = false;
|
||||
}
|
||||
}*/
|
||||
|
||||
ContactsController.setupAvatar(this, avatarImage, avatarDrawable, null, m_mrChat);
|
||||
// /can be deleted if this gets out-of-labs
|
||||
}
|
||||
|
||||
if (getMeasuredWidth() != 0 || getMeasuredHeight() != 0) {
|
||||
buildLayout();
|
||||
@@ -612,21 +558,20 @@ public class DialogCell extends BaseCell {
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
if (currentDialogId == 0) {
|
||||
if( currentChatId == MrChat.MR_CHAT_ID_ARCHIVED_LINK ) {
|
||||
canvas.save();
|
||||
canvas.translate(getMeasuredWidth()/2-flagWidth/2, getMeasuredHeight()/2-flagLayout.getHeight()/2);
|
||||
flagLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSelected) {
|
||||
canvas.drawRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), backPaint);
|
||||
|
||||
if (currentChatId == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if (drawNameLock) {
|
||||
setDrawableBounds(lockDrawable, nameLockLeft, nameLockTop);
|
||||
lockDrawable.draw(canvas);
|
||||
} else
|
||||
*/
|
||||
if (drawNameGroup) {
|
||||
if (drawGroupIcon) {
|
||||
setDrawableBounds(groupDrawable, nameLockLeft, nameLockTop);
|
||||
groupDrawable.draw(canvas);
|
||||
}
|
||||
@@ -669,31 +614,43 @@ public class DialogCell extends BaseCell {
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogMuted && !drawVerified) { // TODO: if we enable encrypted chats and show the verified logo, we may show both, muted and verivied
|
||||
setDrawableBounds(muteDrawable, nameMuteLeft, AndroidUtilities.dp(16.5f));
|
||||
muteDrawable.draw(canvas);
|
||||
} else if (drawVerified) {
|
||||
setDrawableBounds(verifiedDrawable, nameMuteLeft, AndroidUtilities.dp(16.5f));
|
||||
if (chatVerified) {
|
||||
setDrawableBounds(verifiedDrawable, nameVerifiedLeft, AndroidUtilities.dp(16.5f));
|
||||
verifiedDrawable.draw(canvas);
|
||||
}
|
||||
|
||||
if (chatMuted) {
|
||||
setDrawableBounds(muteDrawable, muteLeft, AndroidUtilities.dp(44));
|
||||
muteDrawable.draw(canvas);
|
||||
}
|
||||
|
||||
if (drawError) {
|
||||
setDrawableBounds(errorDrawable, errorLeft, errorTop);
|
||||
errorDrawable.draw(canvas);
|
||||
} else if(drawFlag) {
|
||||
canvas.save();
|
||||
canvas.translate(flagLeft, countTop + AndroidUtilities.dp(4));
|
||||
flagLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
} else if (drawCount) {
|
||||
if (dialogMuted) {
|
||||
setDrawableBounds(countDrawableGrey, countLeft - AndroidUtilities.dp(5.5f), countTop, countWidth + AndroidUtilities.dp(11), countDrawable.getIntrinsicHeight());
|
||||
countDrawableGrey.draw(canvas);
|
||||
} else {
|
||||
setDrawableBounds(countDrawable, countLeft - AndroidUtilities.dp(5.5f), countTop, countWidth + AndroidUtilities.dp(11), countDrawable.getIntrinsicHeight());
|
||||
countDrawable.draw(canvas);
|
||||
}
|
||||
setDrawableBounds(countDrawable, countLeft - AndroidUtilities.dp(5.5f), countTop, countWidth + AndroidUtilities.dp(11), countDrawable.getIntrinsicHeight());
|
||||
countDrawable.draw(canvas);
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(countLeft, countTop + AndroidUtilities.dp(4));
|
||||
countLayout.draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
if( currentChatId==MrChat.MR_CHAT_ID_DEADDROP ) {
|
||||
int shrink = AndroidUtilities.dp(12);
|
||||
setDrawableBounds(closeDrawable, avatarLeft+shrink, avatarTop+shrink, avatarWH-shrink*2, avatarWH-shrink*2);
|
||||
closeDrawable.draw(canvas);
|
||||
}
|
||||
else {
|
||||
avatarImage.draw(canvas);
|
||||
}
|
||||
|
||||
if (useSeparator) {
|
||||
if (LocaleController.isRTL) {
|
||||
canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, linePaint);
|
||||
@@ -701,8 +658,6 @@ public class DialogCell extends BaseCell {
|
||||
canvas.drawLine(AndroidUtilities.dp(AndroidUtilities.leftBaseline), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint);
|
||||
}
|
||||
}
|
||||
|
||||
avatarImage.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
+38
-30
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
*
|
||||
@@ -25,7 +25,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -39,8 +39,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class EditTextCell extends FrameLayout {
|
||||
|
||||
@@ -49,14 +48,20 @@ public class EditTextCell extends FrameLayout {
|
||||
private static Paint paint;
|
||||
private boolean needDivider;
|
||||
private boolean useLabel;
|
||||
private boolean multiLine;
|
||||
|
||||
public EditTextCell(Context context) {
|
||||
this(context, true);
|
||||
this(context, true, false);
|
||||
}
|
||||
|
||||
public EditTextCell(Context context, boolean useLabel__) {
|
||||
public EditTextCell(Context context, boolean useLabel) {
|
||||
this(context, useLabel, false);
|
||||
}
|
||||
|
||||
public EditTextCell(Context context, boolean useLabel__, boolean multiLine__) {
|
||||
super(context);
|
||||
useLabel = useLabel__;
|
||||
multiLine = multiLine__;
|
||||
|
||||
if (paint == null) {
|
||||
paint = new Paint();
|
||||
@@ -75,41 +80,44 @@ public class EditTextCell extends FrameLayout {
|
||||
addView(labelTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.TOP,
|
||||
17, 8, 17, 0));
|
||||
|
||||
|
||||
editView = new EditText(context);
|
||||
editView.setTextColor(0xff212121); // ok
|
||||
editView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); // ok, normal text is 16
|
||||
editView.setLines(1);
|
||||
editView.setMaxLines(1);
|
||||
editView.setSingleLine(true);
|
||||
editView.setTextColor(0xff212121);
|
||||
editView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); // normal text is 16
|
||||
int addImeFlag = 0, addInputType = 0;
|
||||
if( multiLine__ ) {
|
||||
editView.setLines(2);
|
||||
editView.setMaxLines(2);
|
||||
editView.setSingleLine(false);
|
||||
editView.setVerticalScrollBarEnabled(true);
|
||||
editView.setHorizontalScrollBarEnabled(false);
|
||||
editView.setMinimumHeight(AndroidUtilities.dp(100));
|
||||
addInputType = EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE|EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||
}
|
||||
else {
|
||||
editView.setLines(1);
|
||||
editView.setMaxLines(1);
|
||||
editView.setSingleLine(true);
|
||||
addInputType = InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||
addImeFlag = EditorInfo.IME_ACTION_DONE; // just close the keyboard, NEXT would not work as the other entries nay not yet loaded
|
||||
}
|
||||
editView.setHintTextColor(0xffBBBBBB); // was: 0xff979797
|
||||
editView.setGravity(Gravity.START);
|
||||
editView.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||
editView.setImeOptions(EditorInfo.IME_ACTION_DONE); // just close the keyboard, NEXT would not work as the other entries nay not yet loaded
|
||||
AndroidUtilities.clearCursorDrawable(editView);
|
||||
/*
|
||||
e.setPadding(0, 0, 0, 0);
|
||||
e.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
||||
if (i == EditorInfo.IME_ACTION_DONE && doneButton != null) {
|
||||
doneButton.performClick();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
*/
|
||||
editView.setInputType(editView.getInputType()|addInputType);
|
||||
editView.setImeOptions(addImeFlag|EditorInfo.IME_FLAG_NO_EXTRACT_UI);
|
||||
|
||||
addView(editView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.TOP,
|
||||
17, useLabel? 25 : 25-17, 17, 0));
|
||||
17, useLabel? 25 : 25-17, 17, multiLine?17:0));
|
||||
|
||||
setBackgroundColor(0xffffffff);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(useLabel? 64 : 64-15) + (needDivider ? 1 : 0), MeasureSpec.EXACTLY));
|
||||
int dpheight = multiLine? 49*2 : 49;
|
||||
if( useLabel ) {
|
||||
dpheight += 15;
|
||||
}
|
||||
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(dpheight)+(needDivider ? 1 : 0), MeasureSpec.EXACTLY));
|
||||
}
|
||||
|
||||
public void setValueHintAndLabel(String value, String hint, String label, boolean divider) {
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
@@ -31,8 +31,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class GreySectionCell extends FrameLayout {
|
||||
private TextView textView;
|
||||
+17
-10
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
@@ -31,21 +31,28 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class HeaderCell extends FrameLayout {
|
||||
|
||||
private TextView textView;
|
||||
|
||||
static public TextView createTextView(Context context, String text)
|
||||
{
|
||||
TextView ret = new TextView(context);
|
||||
ret.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
ret.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
ret.setTextColor(0xff5099c9);
|
||||
ret.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
|
||||
if( text != null ) {
|
||||
ret.setText(text);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public HeaderCell(Context context) {
|
||||
super(context);
|
||||
|
||||
textView = new TextView(getContext());
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
textView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
textView.setTextColor(0xff5099c9);
|
||||
textView.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
|
||||
textView = createTextView(getContext(), null);
|
||||
addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.START | Gravity.TOP, 17, 15, 17, 0));
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
@@ -34,10 +34,10 @@ import android.widget.FrameLayout;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.CheckBoxView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.PhotoViewer;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.CheckBoxView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.PhotoViewer;
|
||||
|
||||
public class PhotoAttachPhotoCell extends FrameLayout {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
@@ -32,7 +32,7 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class PhotoEditToolCell extends FrameLayout {
|
||||
|
||||
+5
-9
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
@@ -37,8 +37,8 @@ import android.widget.TextView;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class PhotoPickerAlbumsCell extends FrameLayout {
|
||||
|
||||
@@ -158,11 +158,7 @@ public class PhotoPickerAlbumsCell extends FrameLayout {
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int itemWidth;
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
itemWidth = (AndroidUtilities.dp(490) - ((albumsCount + 1) * AndroidUtilities.dp(4))) / albumsCount;
|
||||
} else {
|
||||
itemWidth = (AndroidUtilities.displaySize.x - ((albumsCount + 1) * AndroidUtilities.dp(4))) / albumsCount;
|
||||
}
|
||||
itemWidth = (AndroidUtilities.displaySize.x - ((albumsCount + 1) * AndroidUtilities.dp(4))) / albumsCount;
|
||||
|
||||
for (int a = 0; a < albumsCount; a++) {
|
||||
LayoutParams layoutParams = (LayoutParams) albumViews[a].getLayoutParams();
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -33,9 +33,9 @@ import android.widget.FrameLayout;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.CheckBoxView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.CheckBoxView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class PhotoPickerPhotoCell extends FrameLayout {
|
||||
|
||||
+10
-14
@@ -1,7 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* Delta Chat Android
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
*
|
||||
@@ -21,14 +20,12 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
@@ -42,14 +39,13 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
public class DrawerProfileCell extends FrameLayout {
|
||||
public class SettingsProfileCell extends FrameLayout {
|
||||
|
||||
private TextView nameTextView;
|
||||
private TextView subtitleTextView;
|
||||
@@ -57,18 +53,18 @@ public class DrawerProfileCell extends FrameLayout {
|
||||
private Rect destRect = new Rect();
|
||||
private Paint paint = new Paint();
|
||||
|
||||
public DrawerProfileCell(Context context) {
|
||||
public SettingsProfileCell(Context context) {
|
||||
super(context);
|
||||
setBackgroundColor(Theme.ACTION_BAR_COLOR);
|
||||
|
||||
ImageView shadowView = new ImageView(context);
|
||||
shadowView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
shadowView.setImageResource(R.drawable.bottom_shadow);
|
||||
addView(shadowView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 100/*EDIT BY MR, was 70*/, Gravity.START | Gravity.BOTTOM));
|
||||
addView(shadowView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 85/*shadow height*/, Gravity.START | Gravity.BOTTOM));
|
||||
|
||||
nameTextView = new TextView(context);
|
||||
nameTextView.setTextColor(0xffffffff);
|
||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 23);
|
||||
nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 26);
|
||||
nameTextView.setLines(1);
|
||||
nameTextView.setMaxLines(1);
|
||||
nameTextView.setSingleLine(true);
|
||||
@@ -78,7 +74,7 @@ public class DrawerProfileCell extends FrameLayout {
|
||||
|
||||
subtitleTextView = new TextView(context);
|
||||
subtitleTextView.setTextColor(0xffc2e5ff);
|
||||
subtitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
|
||||
subtitleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, Theme.ACTION_BAR_SUBTITLE_TEXT_SIZE);
|
||||
subtitleTextView.setLines(1);
|
||||
subtitleTextView.setMaxLines(1);
|
||||
subtitleTextView.setSingleLine(true);
|
||||
@@ -89,7 +85,7 @@ public class DrawerProfileCell extends FrameLayout {
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int mrHeight = 180;
|
||||
int mrHeight = 100/*see also shadow height above*/;
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(mrHeight) + AndroidUtilities.statusBarHeight, MeasureSpec.EXACTLY));
|
||||
} else {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Paint;
|
||||
@@ -36,9 +36,9 @@ import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ImageReceiver;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.CheckBoxView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.CheckBoxView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class SharedDocumentCell extends FrameLayout {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -35,7 +35,7 @@ import android.widget.CheckBox;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class TextCheckCell extends FrameLayout {
|
||||
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -32,8 +32,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class TextDetailSettingsCell extends FrameLayout {
|
||||
|
||||
+12
-8
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
*
|
||||
@@ -20,7 +20,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.TypedValue;
|
||||
@@ -29,8 +29,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
|
||||
public class TextInfoCell extends FrameLayout {
|
||||
@@ -40,13 +39,18 @@ public class TextInfoCell extends FrameLayout {
|
||||
|
||||
private final int iconDp = 34;
|
||||
|
||||
static public TextView createTextView(Context context) {
|
||||
TextView ret = new TextView(context);
|
||||
ret.setTextColor(0xff808080);
|
||||
ret.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
ret.setGravity(Gravity.START);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public TextInfoCell(Context context) {
|
||||
super(context);
|
||||
|
||||
textView = new TextView(context);
|
||||
textView.setTextColor(0xff808080);
|
||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
textView.setGravity(Gravity.START);
|
||||
textView = createTextView(context);
|
||||
addView(textView);
|
||||
|
||||
iconView = new TextView(context);
|
||||
+3
-5
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -30,12 +30,10 @@ import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
import static com.b44t.messenger.AndroidUtilities.dp;
|
||||
|
||||
+24
-41
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,9 +21,10 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
@@ -32,33 +33,29 @@ import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ContactsController;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.Components.AvatarDrawable;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.CheckBoxView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.ActionBar.SimpleTextView;
|
||||
import com.b44t.messenger.Components.AvatarDrawable;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.CheckBoxView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.ActionBar.SimpleTextView;
|
||||
|
||||
public class UserCell extends FrameLayout {
|
||||
|
||||
private BackupImageView avatarImageView;
|
||||
private SimpleTextView nameTextView;
|
||||
private SimpleTextView statusTextView;
|
||||
private ImageView imageView;
|
||||
private CheckBoxView checkBox;
|
||||
|
||||
private AvatarDrawable avatarDrawable;
|
||||
private MrContact m_mrContact;
|
||||
|
||||
private CharSequence currentName;
|
||||
private CharSequence currentStatus;
|
||||
private int currentResId;
|
||||
|
||||
private int statusColor = 0xffa8a8a8;
|
||||
|
||||
public UserCell(Context context, int padding, int useCheckboxes) {
|
||||
public UserCell(Context context, int useCheckboxes) {
|
||||
super(context);
|
||||
|
||||
int padding = 1;
|
||||
|
||||
avatarDrawable = new AvatarDrawable();
|
||||
|
||||
avatarImageView = new BackupImageView(context);
|
||||
@@ -67,20 +64,16 @@ public class UserCell extends FrameLayout {
|
||||
|
||||
nameTextView = new SimpleTextView(context);
|
||||
nameTextView.setTextColor(0xff212121);
|
||||
nameTextView.setTextSize(16); /*same size as in TextCell */
|
||||
nameTextView.setTextSize(16);
|
||||
nameTextView.setGravity(Gravity.START | Gravity.TOP);
|
||||
addView(nameTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 20, Gravity.START | Gravity.TOP, LocaleController.isRTL ? 28 + (useCheckboxes == 2 ? 18 : 0) : (68 + padding), 11.5f, LocaleController.isRTL ? (68 + padding) : 28 + (useCheckboxes == 2 ? 18 : 0), 0));
|
||||
|
||||
statusTextView = new SimpleTextView(context);
|
||||
statusTextView.setTextSize(14);
|
||||
statusTextView.setTextColor(0xffa8a8a8);
|
||||
statusTextView.setGravity(Gravity.START | Gravity.TOP);
|
||||
addView(statusTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 20, Gravity.START | Gravity.TOP, LocaleController.isRTL ? 28 : (68 + padding), 34.5f, LocaleController.isRTL ? (68 + padding) : 28, 0));
|
||||
|
||||
imageView = new ImageView(context);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER);
|
||||
imageView.setVisibility(GONE);
|
||||
addView(imageView, LayoutHelper.createFrame(LayoutParams.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL, LocaleController.isRTL ? 0 : 16, 0, LocaleController.isRTL ? 16 : 0, 0));
|
||||
|
||||
if( useCheckboxes == 1 ) {
|
||||
checkBox = new CheckBoxView(context, R.drawable.round_check2);
|
||||
checkBox.setVisibility(INVISIBLE);
|
||||
@@ -88,13 +81,8 @@ public class UserCell extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void setData(MrContact mrContact, int resId) {
|
||||
public void setData(MrContact mrContact) {
|
||||
m_mrContact = mrContact;
|
||||
if( m_mrContact != null ) {
|
||||
currentName = m_mrContact.getDisplayName();
|
||||
currentStatus = m_mrContact.getAddr();
|
||||
}
|
||||
currentResId = resId;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -112,27 +100,22 @@ public class UserCell extends FrameLayout {
|
||||
super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(64), MeasureSpec.EXACTLY));
|
||||
}
|
||||
|
||||
public void setStatusColors(int color) {
|
||||
statusColor = color;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
if (m_mrContact==null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentName != null) {
|
||||
nameTextView.setText(currentName);
|
||||
}
|
||||
nameTextView.setText(m_mrContact.getDisplayName());
|
||||
|
||||
if (currentStatus != null) {
|
||||
statusTextView.setTextColor(statusColor);
|
||||
statusTextView.setText(currentStatus);
|
||||
}
|
||||
statusTextView.setText(m_mrContact.getAddr());
|
||||
|
||||
if (imageView.getVisibility() == VISIBLE && currentResId == 0 || imageView.getVisibility() == GONE && currentResId != 0) {
|
||||
imageView.setVisibility(currentResId == 0 ? GONE : VISIBLE);
|
||||
imageView.setImageResource(currentResId);
|
||||
if( m_mrContact.isVerified() ) {
|
||||
if( MrMailbox.getConfigInt("qr_enabled", 0) != 0 ) {
|
||||
nameTextView.setRightDrawable(R.drawable.verified);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nameTextView.setRightDrawable(0);
|
||||
}
|
||||
|
||||
ContactsController.setupAvatar(avatarImageView, avatarImageView.imageReceiver, avatarDrawable, m_mrContact, null);
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Cells;
|
||||
package com.b44t.messenger.Cells;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -33,8 +33,8 @@ import android.widget.ImageView;
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.ui.Components.BackupImageView;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.BackupImageView;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
|
||||
public class WallpaperCell extends FrameLayout {
|
||||
|
||||
+382
-174
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui;
|
||||
package com.b44t.messenger;
|
||||
|
||||
import android.Manifest;
|
||||
import android.animation.Animator;
|
||||
@@ -43,10 +43,13 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.text.style.URLSpan;
|
||||
import android.util.Log;
|
||||
import android.util.SparseIntArray;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
@@ -59,46 +62,28 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.BuildConfig;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.MrMsg;
|
||||
import com.b44t.messenger.NotificationsController;
|
||||
import com.b44t.messenger.SendMessagesHelper;
|
||||
import com.b44t.messenger.Utilities;
|
||||
import com.b44t.messenger.VideoEditedInfo;
|
||||
import com.b44t.messenger.browser.Browser;
|
||||
import com.b44t.messenger.support.widget.LinearLayoutManager;
|
||||
import com.b44t.messenger.support.widget.RecyclerView;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.ActionBar.BackDrawable;
|
||||
import com.b44t.ui.ActionBar.SimpleTextView;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.ui.Cells.ChatActionCell;
|
||||
import com.b44t.ui.ActionBar.ActionBar;
|
||||
import com.b44t.ui.ActionBar.ActionBarMenu;
|
||||
import com.b44t.ui.ActionBar.ActionBarMenuItem;
|
||||
import com.b44t.ui.Cells.ChatMessageCell;
|
||||
import com.b44t.ui.Cells.ChatUnreadCell;
|
||||
import com.b44t.ui.ActionBar.BaseFragment;
|
||||
import com.b44t.ui.Components.ChatActivityEnterView;
|
||||
import com.b44t.messenger.ImageReceiver;
|
||||
import com.b44t.ui.Components.ChatAttachAlert;
|
||||
import com.b44t.ui.Components.ChatAvatarContainer;
|
||||
import com.b44t.ui.Components.LayoutHelper;
|
||||
import com.b44t.ui.Components.NumberTextView;
|
||||
import com.b44t.ui.Components.RecyclerListView;
|
||||
import com.b44t.ui.Components.SizeNotifierFrameLayout;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.Components.Browser;
|
||||
import com.b44t.messenger.aosp.LinearLayoutManager;
|
||||
import com.b44t.messenger.aosp.RecyclerView;
|
||||
import com.b44t.messenger.ActionBar.BackDrawable;
|
||||
import com.b44t.messenger.ActionBar.SimpleTextView;
|
||||
import com.b44t.messenger.Cells.ChatActionCell;
|
||||
import com.b44t.messenger.ActionBar.ActionBar;
|
||||
import com.b44t.messenger.ActionBar.ActionBarMenu;
|
||||
import com.b44t.messenger.ActionBar.ActionBarMenuItem;
|
||||
import com.b44t.messenger.Cells.ChatMessageCell;
|
||||
import com.b44t.messenger.Cells.ChatUnreadCell;
|
||||
import com.b44t.messenger.ActionBar.BaseFragment;
|
||||
import com.b44t.messenger.Components.ChatActivityEnterView;
|
||||
import com.b44t.messenger.Components.ChatAttachAlert;
|
||||
import com.b44t.messenger.Components.ChatAvatarContainer;
|
||||
import com.b44t.messenger.Components.LayoutHelper;
|
||||
import com.b44t.messenger.Components.NumberTextView;
|
||||
import com.b44t.messenger.Components.RecyclerListView;
|
||||
import com.b44t.messenger.Components.SizeNotifierFrameLayout;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
import java.io.Console;
|
||||
import java.io.File;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
@@ -106,12 +91,13 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class ChatActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, DialogsActivity.DialogsActivityDelegate,
|
||||
public class ChatActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, ChatlistActivity.ChatlistActivityDelegate,
|
||||
PhotoViewer.PhotoViewerProvider {
|
||||
|
||||
// data
|
||||
private long dialog_id;
|
||||
public MrChat m_mrChat = new MrChat(0);
|
||||
private boolean m_isChatWithDeaddrop /*, m_isDeaddropInChatlist*/;
|
||||
private int[] m_msglist = {};
|
||||
|
||||
// the list view
|
||||
@@ -151,7 +137,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
private boolean paused = true;
|
||||
private boolean wasPaused = false;
|
||||
private boolean readWhenResume = false;
|
||||
private SparseIntArray markseenWhenResume = new SparseIntArray();
|
||||
|
||||
private boolean scrollToTopOnResume;
|
||||
private boolean forceScrollToTop;
|
||||
@@ -178,8 +164,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private final static int ID_COPY = 10;
|
||||
private final static int ID_FORWARD = 11;
|
||||
private final static int ID_DELETE_MESSAGES = 12;
|
||||
private final static int ID_LEAVE_GROUP = 13;
|
||||
private final static int ID_ATTACH = 14;
|
||||
private final static int ID_SHOW_PROFILE = 15;
|
||||
private final static int ID_DELETE_CHAT = 16;
|
||||
private final static int ID_ARCHIVE_CHAT = 17;
|
||||
private final static int ID_MUTE = 18;
|
||||
private final static int ID_REPLY = 19;
|
||||
private final static int ID_INFO = 20;
|
||||
@@ -187,6 +176,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private final static int ID_SHARE = 22;
|
||||
private final static int ID_OPEN = 23;
|
||||
private final static int ID_SEARCH = 40;
|
||||
private final static int ID_SHOW_QR = 50;
|
||||
private final static int ID_CHAT_COMPOSE_PANEL = 1000;
|
||||
private TextView m_replyMenuItem, m_infoMenuItem, m_saveToXXMenuItem, m_openMenuItem, m_shareMenuItem;
|
||||
|
||||
@@ -202,11 +192,16 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
dialog_id = arguments.getInt("chat_id", 0);
|
||||
m_mrChat = MrMailbox.getChat((int)dialog_id);
|
||||
m_isChatWithDeaddrop = m_mrChat.getId()==MrChat.MR_CHAT_ID_DEADDROP;
|
||||
|
||||
/*m_isDeaddropInChatlist = false;
|
||||
if( m_isChatWithDeaddrop && MrMailbox.getConfigInt("show_deaddrop", 0)!=0 ) {
|
||||
m_isDeaddropInChatlist = true;
|
||||
}*/
|
||||
|
||||
startLoadFromMessageId = arguments.getInt("message_id", 0);
|
||||
scrollToTopOnResume = arguments.getBoolean("scrollToTopOnResume", false);
|
||||
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.emojiDidLoaded);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.dialogsNeedReload);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.updateInterfaces);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReceivedNewMessages);
|
||||
@@ -224,10 +219,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.waveformCalculated);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.notificationsSettingsUpdated);
|
||||
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.openedChatChanged, dialog_id, false);
|
||||
}
|
||||
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -257,7 +248,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
});
|
||||
|
||||
if (m_mrChat.getId() == MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
if (m_isChatWithDeaddrop) {
|
||||
updateBottomOverlay();
|
||||
}
|
||||
|
||||
@@ -317,7 +308,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
AndroidUtilities.runOnUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MrMailbox.markseenChat((int)dialog_id);
|
||||
MrMailbox.marknoticedChat((int)dialog_id);
|
||||
NotificationsController.getInstance().removeSeenMessages();
|
||||
}
|
||||
}, 700);
|
||||
@@ -336,7 +327,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
chatActivityEnterView.onDestroy();
|
||||
}
|
||||
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.emojiDidLoaded);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.dialogsNeedReload);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.updateInterfaces);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didReceivedNewMessages);
|
||||
@@ -354,15 +344,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.notificationsSettingsUpdated);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioPlayStateChanged);
|
||||
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.openedChatChanged, dialog_id, true);
|
||||
}
|
||||
|
||||
/*
|
||||
if (currentUser != null) {
|
||||
MessagesController.getInstance().cancelLoadFullUser(currentUser.id);
|
||||
}
|
||||
*/
|
||||
AndroidUtilities.removeAdjustResize(getParentActivity(), classGuid);
|
||||
|
||||
if (chatAttachAlert != null) {
|
||||
@@ -435,9 +416,49 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
args.putBoolean("onlySelect", true);
|
||||
args.putString("onlySelectTitle", context.getString(R.string.ForwardToTitle));
|
||||
args.putString("selectAlertString", context.getString(R.string.ForwardMessagesTo));
|
||||
DialogsActivity fragment = new DialogsActivity(args);
|
||||
ChatlistActivity fragment = new ChatlistActivity(args);
|
||||
fragment.setDelegate(ChatActivity.this);
|
||||
presentFragment(fragment); // this results in a call to didSelectDialog()
|
||||
presentFragment(fragment); // this results in a call to didSelectChat()
|
||||
}
|
||||
else if( id == ID_SHOW_PROFILE )
|
||||
{
|
||||
Bundle args = new Bundle();
|
||||
if( m_mrChat.isGroup() ) {
|
||||
args.putInt("chat_id", m_mrChat.getId());
|
||||
}
|
||||
else {
|
||||
int[] contact_ids = MrMailbox.getChatContacts(m_mrChat.getId());
|
||||
if( contact_ids.length==0) {
|
||||
return; // should not happen
|
||||
}
|
||||
args.putInt("user_id", contact_ids[0]);
|
||||
}
|
||||
ProfileActivity fragment = new ProfileActivity(args);
|
||||
presentFragment(fragment);
|
||||
}
|
||||
else if( id == ID_LEAVE_GROUP )
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
MrMailbox.removeContactFromChat(m_mrChat.getId(), MrContact.MR_CONTACT_ID_SELF);
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MrMailbox.UPDATE_MASK_CHAT_MEMBERS);
|
||||
AndroidUtilities.showDoneHint(context);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
builder.setMessage(AndroidUtilities.replaceTags(context.getString(R.string.AskLeaveGroup)));
|
||||
showDialog(builder.create());
|
||||
}
|
||||
else if ( id == ID_ARCHIVE_CHAT)
|
||||
{
|
||||
int do_archive = m_mrChat.getArchived()==0? 1: 0;
|
||||
MrMailbox.archiveChat((int)dialog_id, do_archive);
|
||||
AndroidUtilities.showDoneHint(context);
|
||||
if( do_archive == 1 ) {
|
||||
finishFragment();
|
||||
}
|
||||
}
|
||||
else if ( id == ID_DELETE_CHAT)
|
||||
{
|
||||
@@ -449,24 +470,20 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(context.getString(R.string.AreYouSureDeleteThisChat));
|
||||
builder.setPositiveButton(context.getString(R.string.OK), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
if( MrMailbox.deleteChat((int)dialog_id)!=0 ) {
|
||||
AndroidUtilities.showDoneHint(getParentActivity());
|
||||
finishFragment();
|
||||
}
|
||||
else {
|
||||
AndroidUtilities.showErrorHint(getParentActivity()); // normally, there is no reason for deleteChat to fail() as everything is just local
|
||||
}
|
||||
MrMailbox.deleteChat((int)dialog_id);
|
||||
AndroidUtilities.showDoneHint(getParentActivity());
|
||||
finishFragment();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(context.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
showDialog(builder.create());
|
||||
} else if (id == ID_MUTE) {
|
||||
toggleMute();
|
||||
} else if (id == ID_REPLY) {
|
||||
if( m_mrChat.getId()==MrChat.MR_CHAT_ID_DEADDROP ){
|
||||
if( m_isChatWithDeaddrop ){
|
||||
if( selectedMessagesIds!=null && selectedMessagesIds.size()==1) {
|
||||
ArrayList<Integer> ids = new ArrayList<>(selectedMessagesIds.keySet());
|
||||
createChatByDeaddropMsgId(ids.get(0));
|
||||
@@ -479,13 +496,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
} else if (id == ID_INFO) {
|
||||
String info_str = MrMailbox.getMsgInfo(getFirstSelectedId());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(info_str);
|
||||
builder.setPositiveButton(context.getString(R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
;
|
||||
}
|
||||
});
|
||||
builder.setMessage(AndroidUtilities.replaceTags(info_str));
|
||||
builder.setPositiveButton(R.string.OK, null);
|
||||
showDialog(builder.create());
|
||||
actionBar.hideActionMode();
|
||||
updateVisibleRowsFast();
|
||||
@@ -524,18 +536,32 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
} else if (id == ID_SEARCH) {
|
||||
openSearchWithText("");
|
||||
}
|
||||
else if( id == ID_SHOW_QR ) {
|
||||
Intent intent2 = new Intent(getParentActivity(), QRshowActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putInt("chat_id", (int)dialog_id);
|
||||
intent2.putExtras(b);
|
||||
getParentActivity().startActivity(intent2);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
avatarContainer = new ChatAvatarContainer(context, this);
|
||||
actionBar.addView(avatarContainer, 0, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.START, 56, 0, 40, 0));
|
||||
if( m_isChatWithDeaddrop /*&& !m_isDeaddropInChatlist*/ ) {
|
||||
actionBar.setTitle(context.getString(R.string.Deaddrop));
|
||||
}
|
||||
else {
|
||||
avatarContainer = new ChatAvatarContainer(context, this);
|
||||
actionBar.addView(avatarContainer, 0, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.START, ActionBar.AVATAR_AFTER_BACK_X, 0, 40, 0));
|
||||
}
|
||||
|
||||
ActionBarMenu menu = actionBar.createMenu();
|
||||
|
||||
searchItem = menu.addItem(0, R.drawable.ic_ab_search).setIsSearchField(true, false).setActionBarMenuItemSearchListener(new ActionBarMenuItem.ActionBarMenuItemSearchListener() {
|
||||
@Override
|
||||
public void onSearchCollapse() {
|
||||
avatarContainer.setVisibility(View.VISIBLE);
|
||||
if( avatarContainer != null ) {
|
||||
avatarContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
headerItem.setVisibility(View.VISIBLE);
|
||||
searchItem.setVisibility(View.GONE);
|
||||
highlightMessageId = 0;
|
||||
@@ -579,27 +605,37 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
|
||||
headerItem = menu.addItem(0, R.drawable.ic_ab_other);
|
||||
if (searchItem != null) {
|
||||
headerItem.addSubItem(ID_SEARCH, context.getString(R.string.Search), 0);
|
||||
}
|
||||
headerItem.addSubItem(ID_SEARCH, context.getString(R.string.Search));
|
||||
|
||||
boolean isChatWithDeaddrop = m_mrChat.getId()==MrChat.MR_CHAT_ID_DEADDROP;
|
||||
m_canMute = true;
|
||||
if( isChatWithDeaddrop && MrMailbox.getConfigInt("show_deaddrop", 0)==0 ) {
|
||||
if( m_isChatWithDeaddrop /*&& !m_isDeaddropInChatlist*/ ) {
|
||||
m_canMute = false;
|
||||
}
|
||||
|
||||
if( m_canMute ) {
|
||||
muteMenuEntry = headerItem.addSubItem(ID_MUTE, null, 0);
|
||||
muteMenuEntry = headerItem.addSubItem(ID_MUTE, null);
|
||||
}
|
||||
|
||||
if( !isChatWithDeaddrop ) {
|
||||
headerItem.addSubItem(ID_ATTACH, context.getString(R.string.AttachFiles), 0); // "Attach" means "Attach to chat", not "Attach to message" (which is not possible)
|
||||
headerItem.addSubItem(ID_DELETE_CHAT, context.getString(R.string.DeleteChat), 0);
|
||||
//if( !m_isChatWithDeaddrop ) {
|
||||
//headerItem.addSubItem(ID_ATTACH, context.getString(R.string.AttachFiles), 0); // "Attach" means "Attach to chat", not "Attach to message" (which is not possible)
|
||||
//}
|
||||
|
||||
if( !m_isChatWithDeaddrop ) {
|
||||
headerItem.addSubItem(ID_SHOW_PROFILE, context.getString(R.string.ViewProfile));
|
||||
if( m_mrChat.isGroup() ) {
|
||||
if ( m_mrChat.isVerified() ) {
|
||||
headerItem.addSubItem(ID_SHOW_QR, context.getString(R.string.QrShowInviteCode));
|
||||
}
|
||||
headerItem.addSubItem(ID_LEAVE_GROUP, context.getString(R.string.LeaveGroup));
|
||||
}
|
||||
headerItem.addSubItem(ID_ARCHIVE_CHAT, context.getString(m_mrChat.getArchived()==0? R.string.ArchiveChat : R.string.UnarchiveChat));
|
||||
headerItem.addSubItem(ID_DELETE_CHAT, context.getString(R.string.DeleteChat));
|
||||
}
|
||||
|
||||
updateTitle();
|
||||
avatarContainer.updateSubtitle();
|
||||
if( avatarContainer!=null ) {
|
||||
avatarContainer.updateSubtitle();
|
||||
}
|
||||
updateTitleIcons();
|
||||
|
||||
menuItem = menu.addItem(ID_ATTACH, R.drawable.ic_ab_attach).setAllowCloseAnimation(false); // "menuItem" is added to ChatEnterViewActivity
|
||||
@@ -629,11 +665,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
setMeasuredDimension(width, height);
|
||||
|
||||
actionModeTextView.setTextSize(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 18 : 20);
|
||||
actionModeTextView.setTextSize(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 18 : 20);
|
||||
actionModeTextView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(24), MeasureSpec.AT_MOST));
|
||||
|
||||
if (actionModeSubTextView.getVisibility() != GONE) {
|
||||
actionModeSubTextView.setTextSize(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 14 : 16);
|
||||
actionModeSubTextView.setTextSize(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 14 : 16);
|
||||
actionModeSubTextView.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(20), MeasureSpec.AT_MOST));
|
||||
}
|
||||
}
|
||||
@@ -644,14 +680,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
int textTop;
|
||||
if (actionModeSubTextView.getVisibility() != GONE) {
|
||||
textTop = (height / 2 - actionModeTextView.getTextHeight()) / 2 + AndroidUtilities.dp(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 2 : 3);
|
||||
textTop = (height / 2 - actionModeTextView.getTextHeight()) / 2 + AndroidUtilities.dp(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 2 : 3);
|
||||
} else {
|
||||
textTop = (height - actionModeTextView.getTextHeight()) / 2;
|
||||
}
|
||||
actionModeTextView.layout(0, textTop, actionModeTextView.getMeasuredWidth(), textTop + actionModeTextView.getTextHeight());
|
||||
|
||||
if (actionModeSubTextView.getVisibility() != GONE) {
|
||||
textTop = height / 2 + (height / 2 - actionModeSubTextView.getTextHeight()) / 2 - AndroidUtilities.dp(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 1 : 1);
|
||||
textTop = height / 2 + (height / 2 - actionModeSubTextView.getTextHeight()) / 2 - AndroidUtilities.dp(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 1 : 1);
|
||||
actionModeSubTextView.layout(0, textTop, actionModeSubTextView.getMeasuredWidth(), textTop + actionModeSubTextView.getTextHeight());
|
||||
}
|
||||
}
|
||||
@@ -678,14 +714,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
actionModeViews.add(actionMode.addItem(ID_DELETE_MESSAGES, R.drawable.ic_ab_fwd_delete, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
|
||||
actionModeViews.add(actionMode.addItem(ID_FORWARD, R.drawable.ic_ab_fwd_forward, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
|
||||
ActionBarMenuItem submenu = actionMode.addItem(0, R.drawable.ic_ab_other_grey);
|
||||
if( isChatWithDeaddrop ) {
|
||||
m_replyMenuItem = submenu.addSubItem(ID_REPLY, context.getString(R.string.Reply), 0);
|
||||
if( m_isChatWithDeaddrop ) {
|
||||
m_replyMenuItem = submenu.addSubItem(ID_REPLY, context.getString(R.string.Reply));
|
||||
}
|
||||
submenu.addSubItem(ID_COPY, context.getString(R.string.CopyToClipboard), 0);
|
||||
m_saveToXXMenuItem = submenu.addSubItem(ID_SAVE_TO_XX, "", 0);
|
||||
m_openMenuItem = submenu.addSubItem(ID_OPEN, context.getString(R.string.Open), 0);
|
||||
m_shareMenuItem = submenu.addSubItem(ID_SHARE, context.getString(R.string.Share), 0);
|
||||
m_infoMenuItem = submenu.addSubItem(ID_INFO, context.getString(R.string.Info), 0);
|
||||
submenu.addSubItem(ID_COPY, context.getString(R.string.CopyToClipboard));
|
||||
m_saveToXXMenuItem = submenu.addSubItem(ID_SAVE_TO_XX, "");
|
||||
m_openMenuItem = submenu.addSubItem(ID_OPEN, context.getString(R.string.Open));
|
||||
m_shareMenuItem = submenu.addSubItem(ID_SHARE, context.getString(R.string.Share));
|
||||
m_infoMenuItem = submenu.addSubItem(ID_INFO, context.getString(R.string.Info));
|
||||
actionModeViews.add(submenu);
|
||||
checkActionBarMenu();
|
||||
|
||||
@@ -822,11 +858,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
TextView emptyView = new TextView(context);
|
||||
|
||||
if( m_mrChat.getParamInt(MrChat.MR_CHAT_PARAM_UNPROMOTED, 0)==1 ) {
|
||||
if( m_mrChat.isUnpromoted() ) {
|
||||
emptyView.setText(context.getString(R.string.MsgNewGroupDraftHint));
|
||||
emptyView.setGravity(Gravity.START);
|
||||
}
|
||||
else if( m_mrChat.getType()==MrChat.MR_CHAT_NORMAL ){
|
||||
else if( !m_mrChat.isGroup() && !m_mrChat.isSelfTalk() ){
|
||||
String name = m_mrChat.getName();
|
||||
emptyView.setText(AndroidUtilities.replaceTags(String.format(context.getString(R.string.NoMessagesHint), name, name)));
|
||||
emptyView.setGravity(Gravity.START);
|
||||
@@ -1039,8 +1075,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
//noinspection ResourceType
|
||||
chatActivityEnterView.setId(ID_CHAT_COMPOSE_PANEL);
|
||||
|
||||
chatActivityEnterView.setAllowStickersAndGifs(false, false); // for the moment, we have no stickers
|
||||
|
||||
contentView.addView(chatActivityEnterView, contentView.getChildCount() - 1, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.START | Gravity.BOTTOM));
|
||||
chatActivityEnterView.setDelegate(new ChatActivityEnterView.ChatActivityEnterViewDelegate() {
|
||||
@Override
|
||||
@@ -1061,10 +1095,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
@Override
|
||||
public void onWindowSizeChanged(int size) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStickersTab(boolean opened) {
|
||||
}
|
||||
});
|
||||
|
||||
bottomOverlay = new FrameLayout(context);
|
||||
@@ -1106,8 +1136,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
updateBottomOverlay();
|
||||
|
||||
fixLayoutInternal();
|
||||
|
||||
return fragmentView;
|
||||
}
|
||||
|
||||
@@ -1184,6 +1212,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
private void processSelectedAttach(int which) {
|
||||
if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA ) {
|
||||
if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
getParentActivity().requestPermissions(new String[]{Manifest.permission.CAMERA}, LaunchActivity.REQ_CAMERA_PERMISSION_ID);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
File image = AndroidUtilities.generatePicturePath();
|
||||
@@ -1251,6 +1283,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
presentFragment(fragment);
|
||||
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_VIDEO) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
getParentActivity().requestPermissions(new String[]{Manifest.permission.CAMERA}, LaunchActivity.REQ_CAMERA_PERMISSION_ID);
|
||||
return;
|
||||
}
|
||||
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
|
||||
File video = AndroidUtilities.generateVideoPath();
|
||||
if (video != null) {
|
||||
@@ -1433,7 +1469,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
|
||||
private void createChatByDeaddropMsgId(int messageId)
|
||||
private void createChatByDeaddropMsgId(final int messageId)
|
||||
{
|
||||
final Context context = getParentActivity();
|
||||
if (context == null) {
|
||||
@@ -1452,10 +1488,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setPositiveButton(context.getString(R.string.OK), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
int chatId = MrMailbox.createChatByContactId(fromId);
|
||||
int chatId = MrMailbox.createChatByMsgId(messageId);
|
||||
if( chatId != 0 ) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("chat_id", chatId);
|
||||
@@ -1466,7 +1502,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(context.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
builder.setMessage(AndroidUtilities.replaceTags(String.format(context.getString(R.string.AskStartChatWith), name)));
|
||||
showDialog(builder.create());
|
||||
}
|
||||
@@ -1604,6 +1640,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
if (view instanceof ChatMessageCell) {
|
||||
message = ((ChatMessageCell) view).getMessageObject();
|
||||
}
|
||||
else if( view instanceof ChatActionCell) {
|
||||
message = ((ChatActionCell) view).getMessageObject();
|
||||
}
|
||||
|
||||
if (message==null || !message.isSelectable()) {
|
||||
return;
|
||||
@@ -1630,18 +1669,21 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
|
||||
private void updateTitleIcons() {
|
||||
if (avatarContainer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int rightIcon = 0;
|
||||
int leftIcon = 0, rightIcon = 0;
|
||||
if( m_canMute && MrMailbox.isDialogMuted(dialog_id) ) {
|
||||
rightIcon = R.drawable.mute_fixed;
|
||||
leftIcon = R.drawable.mute_blue;
|
||||
}
|
||||
|
||||
if( m_mrChat!=null && m_mrChat.isVerified() ) {
|
||||
rightIcon = R.drawable.verified;
|
||||
}
|
||||
|
||||
if (avatarContainer != null) {
|
||||
avatarContainer.setTitleIcons(leftIcon, rightIcon);
|
||||
}
|
||||
|
||||
avatarContainer.setTitleIcons(0, rightIcon);
|
||||
if( muteMenuEntry != null ) {
|
||||
if (rightIcon != 0) {
|
||||
if (leftIcon != 0) {
|
||||
muteMenuEntry.setText(ApplicationLoader.applicationContext.getString(R.string.UnmuteNotifications));
|
||||
} else {
|
||||
muteMenuEntry.setText(ApplicationLoader.applicationContext.getString(R.string.MuteNotifications));
|
||||
@@ -1876,21 +1918,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
if (markAsRead) {
|
||||
if (paused) {
|
||||
readWhenResume = true;
|
||||
markseenWhenResume.put(evt_msg_id, 1);
|
||||
} else {
|
||||
MrMailbox.markseenMsg(evt_msg_id);
|
||||
int msg_ids[] = new int[1];
|
||||
msg_ids[0] = evt_msg_id;
|
||||
MrMailbox.markseenMsgs(msg_ids);
|
||||
NotificationsController.getInstance().removeSeenMessages();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (id == NotificationCenter.emojiDidLoaded)
|
||||
{
|
||||
if (chatListView != null) {
|
||||
chatListView.invalidateViews();
|
||||
}
|
||||
}
|
||||
else if (id == NotificationCenter.updateInterfaces)
|
||||
{
|
||||
int updateMask = (Integer) args[0];
|
||||
@@ -2154,7 +2192,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
chatActivityEnterView.setFieldFocused(false);
|
||||
chatActivityEnterView.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
if (m_mrChat.getId()==MrChat.MR_CHAT_ID_DEADDROP) {
|
||||
if (m_isChatWithDeaddrop) {
|
||||
if( m_msglist.length==0 ) {
|
||||
// showing the DeaddropHint if there are no messages is confusing (there are no "reply arrows" in this case)
|
||||
bottomOverlayChatText.setText(ApplicationLoader.applicationContext.getString(R.string.NoMessages));
|
||||
@@ -2214,9 +2252,15 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
scrollToMessage = null;
|
||||
}
|
||||
paused = false;
|
||||
if (readWhenResume ) {
|
||||
readWhenResume = false;
|
||||
MrMailbox.markseenChat((int)dialog_id);
|
||||
|
||||
int markseenWhenResumeCnt = markseenWhenResume.size();
|
||||
if (markseenWhenResumeCnt>0 ) {
|
||||
int msg_ids[] = new int[markseenWhenResumeCnt];
|
||||
for(int i=0; i<markseenWhenResumeCnt; i++) {
|
||||
msg_ids[i] = markseenWhenResume.keyAt(i);
|
||||
}
|
||||
MrMailbox.markseenMsgs(msg_ids);
|
||||
markseenWhenResume.clear();
|
||||
NotificationsController.getInstance().removeSeenMessages();
|
||||
}
|
||||
|
||||
@@ -2298,24 +2342,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
|
||||
private boolean fixLayoutInternal() {
|
||||
/*if (!AndroidUtilities.isTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
selectedMessagesCountTextView.setTextSize(18);
|
||||
} else {
|
||||
selectedMessagesCountTextView.setTextSize(20);
|
||||
}*/
|
||||
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
if (AndroidUtilities.isSmallTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
actionBar.setBackButtonDrawable(new BackDrawable(false));
|
||||
} else {
|
||||
actionBar.setBackButtonDrawable(new BackDrawable(parentLayout == null || parentLayout.fragmentsStack.isEmpty() || parentLayout.fragmentsStack.get(0) == ChatActivity.this || parentLayout.fragmentsStack.size() == 1));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void fixLayout() {
|
||||
if (avatarContainer != null) {
|
||||
avatarContainer.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
|
||||
@@ -2324,7 +2350,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
if (avatarContainer != null) {
|
||||
avatarContainer.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
}
|
||||
return fixLayoutInternal();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2338,7 +2364,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private void createDeleteMessagesAlert() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(ApplicationLoader.applicationContext.getResources().getQuantityString(R.plurals.AreYouSureDeleteMessages, selectedMessagesIds.size(), selectedMessagesIds.size()));
|
||||
builder.setPositiveButton(ApplicationLoader.applicationContext.getString(R.string.OK), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
|
||||
@@ -2355,11 +2381,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
actionBar.hideActionMode();
|
||||
updateVisibleRows();
|
||||
|
||||
MrMailbox.reloadMainChatlist();
|
||||
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogsNeedReload);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(ApplicationLoader.applicationContext.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
showDialog(builder.create());
|
||||
}
|
||||
|
||||
@@ -2421,7 +2446,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didSelectDialog(DialogsActivity dialogsFragment, long fwd_chat_id, boolean param)
|
||||
public void didSelectChat(ChatlistActivity dialogsFragment, long fwd_chat_id, boolean param)
|
||||
{
|
||||
if( selectedMessagesIds.size()>0) {
|
||||
int ids[] = new int[selectedMessagesIds.size()], i = 0;
|
||||
@@ -2441,9 +2466,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
args.putInt("chat_id", (int)fwd_chat_id);
|
||||
ChatActivity fragment = new ChatActivity(args);
|
||||
if( presentFragment(fragment, true /*remove last*/) ) {
|
||||
if (!AndroidUtilities.isTablet()) {
|
||||
removeSelfFromStack();
|
||||
}
|
||||
removeSelfFromStack();
|
||||
}
|
||||
else {
|
||||
dialogsFragment.finishFragment(false);
|
||||
@@ -2504,13 +2527,27 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
messageCell.setHighlightedText(null);
|
||||
}
|
||||
}
|
||||
else if( view_ instanceof ChatActionCell ) {
|
||||
ChatActionCell actionCell = (ChatActionCell)view_;
|
||||
if (actionBar.isActionModeShowed()) {
|
||||
if ( selectedMessagesIds.containsKey(actionCell.getMessageObject().getId()) ) {
|
||||
actionCell.setBackgroundColor(Theme.MSG_SELECTED_BACKGROUND_COLOR);
|
||||
} else {
|
||||
actionCell.setBackgroundColor(0);
|
||||
}
|
||||
} else {
|
||||
actionCell.setBackgroundColor(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
chatListView.invalidate();
|
||||
}
|
||||
|
||||
private void openSearchWithText(String text) {
|
||||
avatarContainer.setVisibility(View.GONE);
|
||||
if( avatarContainer!= null ) {
|
||||
avatarContainer.setVisibility(View.GONE);
|
||||
}
|
||||
headerItem.setVisibility(View.GONE);
|
||||
searchItem.setVisibility(View.VISIBLE);
|
||||
updateBottomOverlay();
|
||||
@@ -2663,11 +2700,15 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("user_id", user.id);
|
||||
ProfileActivity fragment = new ProfileActivity(args);
|
||||
fragment.setPlayProfileAnimation(false);
|
||||
presentFragment(fragment);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didPressedSetupMessage(ChatMessageCell cell) {
|
||||
querySetupCode(cell.getMessageObject().getId(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPerformActions() {
|
||||
return actionBar != null && !actionBar.isActionModeShowed();
|
||||
@@ -2730,13 +2771,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
if( isMailto )
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setPositiveButton(mContext.getString(R.string.OK), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
createChat(urlFinal);
|
||||
createChat(urlFinal);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(mContext.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
builder.setMessage(AndroidUtilities.replaceTags(String.format(mContext.getString(R.string.AskStartChatWith), urlTitle)));
|
||||
showDialog(builder.create());
|
||||
}
|
||||
@@ -2761,13 +2802,21 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
public void didPressedImage(ChatMessageCell cell) {
|
||||
MessageObject message = cell.getMessageObject();
|
||||
|
||||
if( message.type == MessageObject.MO_TYPE3_VIDEO && MrMailbox.getMsg(message.getId()).isIncreation()!=0 ) {
|
||||
if( message.type == MessageObject.MO_TYPE3_VIDEO && MrMailbox.getMsg(message.getId()).isIncreation() ) {
|
||||
return; // we're not ready (still compressing), a hint is already shown in the message itself
|
||||
}
|
||||
|
||||
if( /*(Build.VERSION.SDK_INT >= 16 && message.isVideo()) ||*/ message.type == MessageObject.MO_TYPE1_PHOTO || message.isGif()) {
|
||||
PhotoViewer.getInstance().setParentActivity(getParentActivity());
|
||||
PhotoViewer.getInstance().openPhoto(message, message.type != MessageObject.MO_TYPE0_TEXT ? dialog_id : 0, ChatActivity.this);
|
||||
//PhotoViewer.getInstance().openPhoto(message, message.type != MessageObject.MO_TYPE0_TEXT ? dialog_id : 0,
|
||||
// ChatActivity.this, getPhotosInChat());
|
||||
//ArrayList<Object> photos = getPhotosInChat();
|
||||
int index = getIndexOfCellPhoto(cell);
|
||||
//PhotoViewer.getInstance().openPhoto(null, 0, ChatActivity.this, photos, index);
|
||||
|
||||
ArrayList<MessageObject> photoMessages = getPhotoMessages();
|
||||
PhotoViewer.getInstance().openPhotoList(message, message.type != MessageObject.MO_TYPE0_TEXT ? dialog_id : 0,
|
||||
ChatActivity.this, photoMessages, index);
|
||||
} else if (message.type == MessageObject.MO_TYPE9_FILE || message.type == MessageObject.MO_TYPE3_VIDEO ) {
|
||||
AndroidUtilities.openForViewOrShare(getParentActivity(), message.getId(), Intent.ACTION_VIEW);
|
||||
}
|
||||
@@ -2787,7 +2836,45 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
return new Holder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
private ArrayList<MessageObject> getPhotoMessages() {
|
||||
ArrayList<MessageObject> photos = new ArrayList<>();
|
||||
|
||||
for(int msg_index = 0; msg_index < m_msglist.length; msg_index ++) {
|
||||
MrMsg mrMsg = MrMailbox.getMsg(m_msglist[msg_index]);
|
||||
switch (mrMsg.getType()) {
|
||||
case MrMsg.MR_MSG_IMAGE:
|
||||
case MrMsg.MR_MSG_GIF:
|
||||
{
|
||||
|
||||
TLRPC.Message msg = mrMsg.get_TLRPC_Message();
|
||||
// generateLayout replaces emojis in text and other text rendering actions.
|
||||
MessageObject photoMsg = new MessageObject(msg, false);
|
||||
|
||||
photos.add(photoMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
return photos;
|
||||
}
|
||||
|
||||
private int getIndexOfCellPhoto(ChatMessageCell callingCell) {
|
||||
int photoCount = 0;
|
||||
for(int msg_index = 0; msg_index < m_msglist.length; msg_index ++) {
|
||||
MrMsg msg = MrMailbox.getMsg(m_msglist[msg_index]);
|
||||
switch (msg.getType()) {
|
||||
case MrMsg.MR_MSG_IMAGE:
|
||||
case MrMsg.MR_MSG_GIF:
|
||||
{
|
||||
if(callingCell.getMessageObject().getId() == msg.getId())
|
||||
return photoCount; // count up until now.
|
||||
photoCount ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0; // didn't find the matching photo.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int i) {
|
||||
if (i >= 0 && i < m_msglist.length) {
|
||||
View view = holder.itemView;
|
||||
@@ -2816,8 +2903,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
MessageObject msgDrawObj = new MessageObject(msg, true);
|
||||
|
||||
ChatMessageCell messageCell = (ChatMessageCell) view;
|
||||
messageCell.isGroupChat = m_mrChat.getType()==MrChat.MR_CHAT_GROUP;
|
||||
messageCell.setMessageObject(msgDrawObj);
|
||||
messageCell.isGroupChat = m_mrChat.isGroup();
|
||||
messageCell.setMessageObject(msgDrawObj, m_isChatWithDeaddrop);
|
||||
messageCell.setCheckPressed(!disableSelection, disableSelection && selected);
|
||||
messageCell.setHighlighted(highlightMessageId != 0 && msgDrawObj.getId() == highlightMessageId);
|
||||
|
||||
@@ -2826,11 +2913,24 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
} else {
|
||||
messageCell.setHighlightedText(null);
|
||||
}
|
||||
|
||||
// mark message as being read
|
||||
int state = mrMsg.getState();
|
||||
if( state == MrMsg.MR_IN_FRESH || state==MrMsg.MR_IN_NOTICED ) {
|
||||
if(paused) {
|
||||
markseenWhenResume.put(msg_id, 1);
|
||||
}
|
||||
else {
|
||||
int msg_ids[] = new int[1];
|
||||
msg_ids[0] = msg_id;
|
||||
MrMailbox.markseenMsgs(msg_ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( view instanceof ChatActionCell )
|
||||
{
|
||||
// show a date headline (the date comes from the _next_ message)
|
||||
if( msg_id == MrMsg.MR_MSG_ID_DAYMARKER && i+1 < m_msglist.length ) {
|
||||
// show a date headline (the date comes from the _next_ message)
|
||||
MrMsg mrMsg = MrMailbox.getMsg(m_msglist[i+1]);
|
||||
|
||||
TLRPC.Message dateMsg = new TLRPC.Message();
|
||||
@@ -2841,6 +2941,28 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
msgDrawObj.type = MessageObject.MO_TYPE10_DATE_HEADLINE;
|
||||
msgDrawObj.contentType = ROWTYPE_DATE_HEADLINE;
|
||||
|
||||
ChatActionCell actionCell = (ChatActionCell) view;
|
||||
actionCell.setMessageObject(msgDrawObj);
|
||||
}
|
||||
else {
|
||||
MrMsg mrMsg = MrMailbox.getMsg(msg_id);
|
||||
|
||||
MessageObject msgDrawObj = new MessageObject(mrMsg.get_TLRPC_Message(), false);
|
||||
|
||||
// Add the suffix " (by ...)" to the action, see strings.xml for details.
|
||||
int fromId = mrMsg.getFromId();
|
||||
if( fromId != MrContact.MR_CONTACT_ID_DEVICE ) {
|
||||
String actionStr = msgDrawObj.messageText.toString();
|
||||
if(actionStr.endsWith(".")) { actionStr = actionStr.substring(0, actionStr.length() - 1); }
|
||||
if( fromId == MrContact.MR_CONTACT_ID_SELF ) {
|
||||
msgDrawObj.messageText = String.format(ApplicationLoader.applicationContext.getString(R.string.ActionBySelf), actionStr);
|
||||
}
|
||||
else {
|
||||
String fromStr = MrMailbox.getContact(mrMsg.getFromId()).getFirstName();
|
||||
msgDrawObj.messageText = String.format(ApplicationLoader.applicationContext.getString(R.string.ActionByUser), actionStr, fromStr);
|
||||
}
|
||||
}
|
||||
|
||||
ChatActionCell actionCell = (ChatActionCell) view;
|
||||
actionCell.setMessageObject(msgDrawObj);
|
||||
}
|
||||
@@ -2862,6 +2984,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
else if( m_msglist[i]==MrMsg.MR_MSG_ID_MARKER1 ) {
|
||||
return ROWTYPE_UNREAD_HEADLINE;
|
||||
}
|
||||
|
||||
if( MrMailbox.getMsg(m_msglist[i]).isInfo() ) {
|
||||
return ROWTYPE_DATE_HEADLINE;
|
||||
}
|
||||
|
||||
}
|
||||
return ROWTYPE_MESSAGE_CELL;
|
||||
}
|
||||
@@ -2893,4 +3020,85 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void querySetupCode(final int msg_id, String[] preload)
|
||||
{
|
||||
if( !MrMailbox.getMsg(msg_id).isSetupMessage()) {
|
||||
return;
|
||||
}
|
||||
|
||||
View gl = View.inflate(getParentActivity(), R.layout.setup_code_grid, null);
|
||||
final EditText[] editTexts = {
|
||||
(EditText) gl.findViewById(R.id.setupCode0), (EditText) gl.findViewById(R.id.setupCode1), (EditText) gl.findViewById(R.id.setupCode2),
|
||||
(EditText) gl.findViewById(R.id.setupCode3), (EditText) gl.findViewById(R.id.setupCode4), (EditText) gl.findViewById(R.id.setupCode5),
|
||||
(EditText) gl.findViewById(R.id.setupCode6), (EditText) gl.findViewById(R.id.setupCode7), (EditText) gl.findViewById(R.id.setupCode8)
|
||||
};
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(getParentActivity());
|
||||
builder1.setView(gl);
|
||||
editTexts[0].setText(MrMailbox.getMsg(msg_id).getSetupCodeBegin());
|
||||
editTexts[0].setSelection(editTexts[0].getText().length());
|
||||
|
||||
for( int i = 0; i < 9; i++ ) {
|
||||
if( preload != null && i < preload.length ) {
|
||||
editTexts[i].setText(preload[i]);
|
||||
editTexts[i].setSelection(editTexts[i].getText().length());
|
||||
}
|
||||
editTexts[i].addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if( s.length()==4 ) {
|
||||
for ( int i = 0; i < 8; i++ ) {
|
||||
if( editTexts[i].hasFocus() && editTexts[i+1].getText().length()<4 ) {
|
||||
editTexts[i+1].requestFocus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
builder1.setTitle(ApplicationLoader.applicationContext.getString(R.string.AutocryptKeyTransfer));
|
||||
builder1.setMessage(AndroidUtilities.replaceTags(ApplicationLoader.applicationContext.getString(R.string.AutocryptKeyTransferPleaseEnterCode)));
|
||||
builder1.setNegativeButton(R.string.Cancel, null);
|
||||
builder1.setCancelable(false); // prevent the dialog from being dismissed accidentally (when the dialog is closed, the setup code is gone forever and the user has to create a new setup message)
|
||||
builder1.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String setup_code = "";
|
||||
final String[] preload = new String[9];
|
||||
for ( int i = 0; i < 9; i++ ) {
|
||||
preload[i] = editTexts[i].getText().toString();
|
||||
setup_code += preload[i];
|
||||
}
|
||||
boolean success = MrMailbox.continueKeyTransfer(msg_id, setup_code);
|
||||
|
||||
AlertDialog.Builder builder2 = new AlertDialog.Builder(getParentActivity());
|
||||
builder2.setTitle(ApplicationLoader.applicationContext.getString(R.string.AutocryptKeyTransfer));
|
||||
builder2.setMessage(AndroidUtilities.replaceTags(ApplicationLoader.applicationContext.getString(success? R.string.AutocryptKeyTransferSucceeded : R.string.AutocryptKeyTransferBadCode)));
|
||||
if( success ) {
|
||||
builder2.setPositiveButton(R.string.OK, null);
|
||||
}
|
||||
else {
|
||||
builder2.setNegativeButton(R.string.Cancel, null);
|
||||
builder2.setPositiveButton(R.string.Retry, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
querySetupCode(msg_id, preload);
|
||||
}
|
||||
});
|
||||
}
|
||||
showDialog(builder2.create());
|
||||
}
|
||||
});
|
||||
showDialog(builder1.create());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapShader;
|
||||
+57
-16
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
@@ -29,38 +29,77 @@ import android.graphics.Paint;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.text.Layout;
|
||||
import android.text.StaticLayout;
|
||||
import android.text.TextPaint;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
|
||||
public class LetterDrawable extends Drawable {
|
||||
public class AvatarDrawable extends Drawable {
|
||||
|
||||
public static Paint paint = new Paint();
|
||||
private static Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private static TextPaint namePaint;
|
||||
private static int[] arrColors = {0xffe56555, 0xfff28c48, 0xff8e85ee, 0xff76c84d, 0xff5bb6cc, 0xff549cdd, 0xffd25c99, 0xffb37800}; /* the colors should contrast to typical action bar colors as well as to white (more important, is used as text color)*/
|
||||
|
||||
private int color;
|
||||
private StaticLayout textLayout;
|
||||
private float textWidth;
|
||||
private float textHeight;
|
||||
private float textLeft;
|
||||
private StringBuilder stringBuilder = new StringBuilder(5);
|
||||
|
||||
public LetterDrawable() {
|
||||
public AvatarDrawable() {
|
||||
super();
|
||||
|
||||
if (namePaint == null) {
|
||||
paint.setColor(0xfff0f0f0);
|
||||
namePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
|
||||
namePaint.setColor(0xffffffff);
|
||||
namePaint.setTextSize(AndroidUtilities.dp(28));
|
||||
namePaint.setTextSize(AndroidUtilities.dp(20));
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
private static int getColorIndex(int id) {
|
||||
return Math.abs(id % arrColors.length);
|
||||
}
|
||||
|
||||
public static int getNameColor(String name) {
|
||||
int id = strChecksum(name);
|
||||
return arrColors[getColorIndex(id)];
|
||||
}
|
||||
|
||||
private static int strChecksum(String str) {
|
||||
int ret = 0;
|
||||
if( str!=null ) {
|
||||
int i;
|
||||
for (i = 0; i < str.length(); i++) {
|
||||
ret += (i+1)*str.charAt(i);
|
||||
ret %= 0x00FFFFFF;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setInfoByName(String name) {
|
||||
int id = strChecksum(name);
|
||||
|
||||
color = arrColors[getColorIndex(id)];
|
||||
|
||||
stringBuilder.setLength(0);
|
||||
if (title != null && title.length() > 0) {
|
||||
stringBuilder.append(title.substring(0, 1));
|
||||
if (name != null && name.length() > 0) {
|
||||
stringBuilder.appendCodePoint(name.codePointAt(0));
|
||||
|
||||
for (int a = name.length() - 1; a >= 0; a--) {
|
||||
if (name.charAt(a) == ' ') {
|
||||
if (a != name.length() - 1 && name.charAt(a + 1) != ' ') {
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
stringBuilder.append("\u200C"); // ZERO WIDTH NON-JOINER - avoids the two letter to melt into a ligature which would be incorrect on the initials
|
||||
}
|
||||
stringBuilder.appendCodePoint(name.codePointAt(a + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stringBuilder.length() > 0) {
|
||||
@@ -87,23 +126,25 @@ public class LetterDrawable extends Drawable {
|
||||
return;
|
||||
}
|
||||
int size = bounds.width();
|
||||
paint.setColor(color);
|
||||
canvas.save();
|
||||
canvas.drawRect(bounds.left, bounds.top, bounds.right, bounds.bottom, paint);
|
||||
canvas.translate(bounds.left, bounds.top);
|
||||
canvas.drawCircle(size / 2, size / 2, size / 2, paint);
|
||||
|
||||
if (textLayout != null) {
|
||||
canvas.translate(bounds.left + (size - textWidth) / 2 - textLeft, bounds.top + (size - textHeight) / 2);
|
||||
canvas.translate((size - textWidth) / 2 - textLeft, (size - textHeight) / 2);
|
||||
textLayout.draw(canvas);
|
||||
}
|
||||
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
|
||||
public void setAlpha(int alpha) { // must be present in non-abstract classes derived from Drawable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter cf) {
|
||||
|
||||
public void setColorFilter(ColorFilter cf) { // must be present in non-abstract classes derived from Drawable
|
||||
}
|
||||
|
||||
@Override
|
||||
+13
-7
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
@@ -40,11 +40,11 @@ import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.messenger.FileLoader;
|
||||
import com.b44t.messenger.UserConfig;
|
||||
import com.b44t.ui.LaunchActivity;
|
||||
import com.b44t.ui.PhotoAlbumPickerActivity;
|
||||
import com.b44t.ui.PhotoCropActivity;
|
||||
import com.b44t.ui.ActionBar.BaseFragment;
|
||||
import com.b44t.ui.PhotoViewer;
|
||||
import com.b44t.messenger.LaunchActivity;
|
||||
import com.b44t.messenger.PhotoAlbumPickerActivity;
|
||||
import com.b44t.messenger.PhotoCropActivity;
|
||||
import com.b44t.messenger.ActionBar.BaseFragment;
|
||||
import com.b44t.messenger.PhotoViewer;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -75,6 +75,12 @@ public class AvatarUpdater implements PhotoCropActivity.PhotoEditActivityDelegat
|
||||
}
|
||||
|
||||
public void openCamera() {
|
||||
if (Build.VERSION.SDK_INT >= 23 && parentFragment != null && parentFragment.getParentActivity() != null) {
|
||||
if (parentFragment.getParentActivity().checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
parentFragment.getParentActivity().requestPermissions(new String[]{Manifest.permission.CAMERA}, LaunchActivity.REQ_CAMERA_PERMISSION_ID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
File image = AndroidUtilities.generatePicturePath();
|
||||
+14
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -32,6 +32,8 @@ import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import com.b44t.messenger.ImageReceiver;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.TLObject;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
|
||||
@@ -142,11 +144,19 @@ public class BackupImageView extends View {
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
int x, y, w, h;
|
||||
if (width != -1 && height != -1) {
|
||||
imageReceiver.setImageCoords((getWidth() - width) / 2, (getHeight() - height) / 2, width, height);
|
||||
x = (getWidth() - width) / 2;
|
||||
y = (getHeight() - height) / 2;
|
||||
w = width;
|
||||
h = height;
|
||||
} else {
|
||||
imageReceiver.setImageCoords(0, 0, getWidth(), getHeight());
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = getWidth();
|
||||
h = getHeight();
|
||||
}
|
||||
imageReceiver.setImageCoords(x, y, w, h);
|
||||
imageReceiver.draw(canvas);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Adapters;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.database.DataSetObserver;
|
||||
import android.view.View;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,14 +21,14 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.messenger.browser;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.b44t.ui.LaunchActivity;
|
||||
import com.b44t.messenger.LaunchActivity;
|
||||
|
||||
public class Browser {
|
||||
|
||||
+37
-135
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.Manifest;
|
||||
import android.animation.Animator;
|
||||
@@ -40,7 +40,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
import android.os.SystemClock;
|
||||
import android.text.Editable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextWatcher;
|
||||
@@ -61,7 +60,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.Emoji;
|
||||
import com.b44t.messenger.EmojiInputView;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.MrContact;
|
||||
@@ -72,11 +71,10 @@ import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.ChatActivity;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.ChatActivity;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ChatActivityEnterView extends FrameLayout implements NotificationCenter.NotificationCenterDelegate, SizeNotifierFrameLayout.SizeNotifierFrameLayoutDelegate /*, StickersAlert.StickersAlertDelegate*/ {
|
||||
@@ -86,7 +84,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
void needSendTyping();
|
||||
void onTextChanged(CharSequence text, boolean bigChange);
|
||||
void onWindowSizeChanged(int size);
|
||||
void onStickersTab(boolean opened);
|
||||
}
|
||||
|
||||
private class SeekBarWaveformView extends View {
|
||||
@@ -149,26 +146,26 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
|
||||
private class EditTextCaption extends EditText {
|
||||
|
||||
private Object editor;
|
||||
private Field editorField;
|
||||
private Drawable[] mCursorDrawable;
|
||||
private Field mCursorDrawableField;
|
||||
//private Object editor;
|
||||
//private Field editorField;
|
||||
//private Drawable[] mCursorDrawable;
|
||||
//private Field mCursorDrawableField;
|
||||
|
||||
public EditTextCaption(Context context) {
|
||||
super(context);
|
||||
|
||||
try {
|
||||
Field field = TextView.class.getDeclaredField("mEditor");
|
||||
field.setAccessible(true);
|
||||
editor = field.get(this);
|
||||
Class editorClass = Class.forName("android.widget.Editor");
|
||||
editorField = editorClass.getDeclaredField("mShowCursor");
|
||||
editorField.setAccessible(true);
|
||||
mCursorDrawableField = editorClass.getDeclaredField("mCursorDrawable");
|
||||
mCursorDrawableField.setAccessible(true);
|
||||
mCursorDrawable = (Drawable[]) mCursorDrawableField.get(editor);
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
//try {
|
||||
//Field field = TextView.class.getDeclaredField("mEditor");
|
||||
//field.setAccessible(true);
|
||||
//editor = field.get(this);
|
||||
//Class editorClass = Class.forName("android.widget.Editor");
|
||||
//editorField = editorClass.getDeclaredField("mShowCursor");
|
||||
//editorField.setAccessible(true);
|
||||
//mCursorDrawableField = editorClass.getDeclaredField("mCursorDrawable");
|
||||
//mCursorDrawableField.setAccessible(true);
|
||||
//mCursorDrawable = (Drawable[]) mCursorDrawableField.get(editor);
|
||||
//} catch (Throwable e) {
|
||||
//}
|
||||
}
|
||||
|
||||
@SuppressLint("DrawAllocation")
|
||||
@@ -189,10 +186,10 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
try {
|
||||
//try {
|
||||
// the following lines are because otherwise the cursor stops blinking if
|
||||
// the focus was set to another text field in between (eg. search)
|
||||
if (editorField != null && mCursorDrawable != null && mCursorDrawable[0] != null) {
|
||||
/*if (editorField != null && mCursorDrawable != null && mCursorDrawable[0] != null) {
|
||||
long mShowCursor = editorField.getLong(editor);
|
||||
boolean showCursor = (SystemClock.uptimeMillis() - mShowCursor) % (2 * 500) < 500;
|
||||
if (showCursor) {
|
||||
@@ -201,9 +198,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
mCursorDrawable[0].draw(canvas);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
}*/
|
||||
//} catch (Throwable e) {
|
||||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,7 +222,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
private EditTextCaption messageEditText;
|
||||
private ImageView sendButton;
|
||||
private ImageView emojiButton;
|
||||
private EmojiView emojiView;
|
||||
private EmojiInputView emojiView;
|
||||
private TextView recordTimeText;
|
||||
private ImageView audioRecordButton;
|
||||
private FrameLayout recordPanel;
|
||||
@@ -424,7 +421,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.recordProgressChanged);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.closeChats);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioDidSent);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.emojiDidLoaded);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioRouteChanged);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioDidReset);
|
||||
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioProgressDidChanged);
|
||||
@@ -570,18 +566,11 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
for (int i = 0; i < spans.length; i++) {
|
||||
editable.removeSpan(spans[i]);
|
||||
}
|
||||
Emoji.replaceEmoji(editable, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20), false);
|
||||
EmojiInputView.replaceEmoji(editable, false);
|
||||
processChange = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
|
||||
mCursorDrawableRes.setAccessible(true);
|
||||
mCursorDrawableRes.set(messageEditText, R.drawable.field_carret);
|
||||
} catch (Exception e) {
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
if (isChat) {
|
||||
attachButton = new LinearLayout(context);
|
||||
@@ -601,7 +590,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
|
||||
ImageView imageView = new ImageView(context);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER);
|
||||
imageView.setImageResource(R.drawable.delete_reply);
|
||||
imageView.setImageResource(R.drawable.dismiss_recording);
|
||||
recordedAudioPanel.addView(imageView, LayoutHelper.createFrame(48, 48));
|
||||
imageView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
@@ -806,24 +795,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setAllowStickersAndGifs(boolean value, boolean value2) {
|
||||
if ((allowStickers != value || allowGifs != value2) && emojiView != null) {
|
||||
if (emojiView.getVisibility() == VISIBLE) {
|
||||
hidePopup(false);
|
||||
}
|
||||
sizeNotifierLayout.removeView(emojiView);
|
||||
emojiView = null;
|
||||
}
|
||||
allowStickers = value;
|
||||
allowGifs = value2;
|
||||
}
|
||||
|
||||
public void setOpenGifsTabFirst() {
|
||||
createEmojiView();
|
||||
emojiView.loadGifRecent();
|
||||
emojiView.switchToGifRecent();
|
||||
}
|
||||
|
||||
public boolean isTopViewVisible() {
|
||||
return false;
|
||||
}
|
||||
@@ -845,13 +816,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.recordProgressChanged);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.closeChats);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioDidSent);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.emojiDidLoaded);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioRouteChanged);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioDidReset);
|
||||
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioProgressDidChanged);
|
||||
if (emojiView != null) {
|
||||
emojiView.onDestroy();
|
||||
}
|
||||
if (mWakeLock != null) {
|
||||
try {
|
||||
mWakeLock.release();
|
||||
@@ -1338,9 +1305,9 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
if (emojiView != null) {
|
||||
return;
|
||||
}
|
||||
emojiView = new EmojiView(allowStickers, allowGifs, parentActivity);
|
||||
emojiView = new EmojiInputView(parentActivity);
|
||||
emojiView.setVisibility(GONE);
|
||||
emojiView.setListener(new EmojiView.Listener() {
|
||||
emojiView.setListener(new EmojiInputView.Listener() {
|
||||
public boolean onBackspace() {
|
||||
if (messageEditText.length() == 0) {
|
||||
return false;
|
||||
@@ -1356,7 +1323,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
}
|
||||
try {
|
||||
innerTextChange = 2;
|
||||
CharSequence localCharSequence = Emoji.replaceEmoji(symbol, messageEditText.getPaint().getFontMetricsInt(), AndroidUtilities.dp(20), false);
|
||||
CharSequence localCharSequence = EmojiInputView.replaceEmoji(symbol, false);
|
||||
messageEditText.setText(messageEditText.getText().insert(i, localCharSequence));
|
||||
int j = i + localCharSequence.length();
|
||||
messageEditText.setSelection(j, j);
|
||||
@@ -1367,47 +1334,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
}
|
||||
}
|
||||
|
||||
/*public void onStickerSelected(TLRPC.Document sticker) {
|
||||
ChatActivityEnterView.this.onStickerSelected(sticker);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void onStickersSettingsClick() {
|
||||
if (parentFragment != null) {
|
||||
//parentFragment.presentFragment(new StickersActivity()); -- EDIT BY MR
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGifSelected(TLRPC.Document gif) {
|
||||
SendMessagesHelper.getInstance().sendSticker(gif, dialog_id);
|
||||
if ((int) dialog_id == 0) {
|
||||
//MessagesController.getInstance().saveGif(gif);
|
||||
}
|
||||
if (delegate != null) {
|
||||
delegate.onMessageSend(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGifTab(boolean opened) {
|
||||
if (!AndroidUtilities.usingHardwareInput) {
|
||||
if (opened) {
|
||||
if (messageEditText.length() == 0) {
|
||||
messageEditText.setText("@gif ");
|
||||
messageEditText.setSelection(messageEditText.length());
|
||||
}
|
||||
} else if (messageEditText.getText().toString().equals("@gif ")) {
|
||||
messageEditText.setText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStickersTab(boolean opened) {
|
||||
delegate.onStickersTab(opened);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClearEmojiRecent() {
|
||||
if (parentFragment == null || parentActivity == null) {
|
||||
@@ -1415,13 +1341,13 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
|
||||
builder.setMessage(ApplicationLoader.applicationContext.getString(R.string.ClearRecentEmoji));
|
||||
builder.setPositiveButton(ApplicationLoader.applicationContext.getString(R.string.ClearButton).toUpperCase(), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(R.string.ClearButton, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
emojiView.clearRecentEmoji();
|
||||
emojiView.clearRecent();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(ApplicationLoader.applicationContext.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
parentFragment.showDialog(builder.create());
|
||||
}
|
||||
});
|
||||
@@ -1429,14 +1355,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
sizeNotifierLayout.addView(emojiView);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public void onStickerSelected(TLRPC.Document sticker) {
|
||||
SendMessagesHelper.getInstance().sendSticker(sticker, dialog_id);
|
||||
if (delegate != null) {
|
||||
delegate.onMessageSend(null);
|
||||
}
|
||||
}*/
|
||||
|
||||
private void showPopup(int show, int contentType /*0=emojiView, 1=botKeyboardView*/ ) {
|
||||
if (show == 1) {
|
||||
if (contentType == 0 && emojiView == null) {
|
||||
@@ -1538,17 +1456,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
return emojiView != null && emojiView.getVisibility() == VISIBLE;
|
||||
}
|
||||
|
||||
public boolean isKeyboardVisible() {
|
||||
return keyboardVisible;
|
||||
}
|
||||
|
||||
public void addRecentGif(MediaController.SearchImage searchImage) {
|
||||
if (emojiView == null) {
|
||||
return;
|
||||
}
|
||||
emojiView.addRecentGif(searchImage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSizeChanged(int height, boolean isWidthGreater) {
|
||||
if (height > AndroidUtilities.dp(50) && keyboardVisible) {
|
||||
@@ -1619,11 +1526,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
|
||||
@Override
|
||||
public void didReceivedNotification(int id, Object... args) {
|
||||
if (id == NotificationCenter.emojiDidLoaded) {
|
||||
if (emojiView != null) {
|
||||
emojiView.invalidateViews();
|
||||
}
|
||||
} else if (id == NotificationCenter.recordProgressChanged) {
|
||||
if (id == NotificationCenter.recordProgressChanged) {
|
||||
long t = (Long) args[0];
|
||||
Long time = t / 1000;
|
||||
int ms = (int) (t % 1000L) / 10;
|
||||
@@ -1665,8 +1568,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
TLRPC.TL_message message = new TLRPC.TL_message();
|
||||
message.out = true;
|
||||
message.id = 0;
|
||||
message.to_id = new TLRPC.TL_peerUser();
|
||||
message.to_id.user_id = message.from_id = MrContact.MR_CONTACT_ID_SELF;
|
||||
message.from_id = MrContact.MR_CONTACT_ID_SELF;
|
||||
message.date = (int) (System.currentTimeMillis() / 1000);
|
||||
message.message = "-1";
|
||||
message.attachPath = audioToSendPath;
|
||||
+10
-11
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.Manifest;
|
||||
import android.animation.Animator;
|
||||
@@ -49,19 +49,18 @@ import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.MediaController;
|
||||
import com.b44t.messenger.MessageObject;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.support.widget.LinearLayoutManager;
|
||||
import com.b44t.messenger.aosp.LinearLayoutManager;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.support.widget.RecyclerView;
|
||||
import com.b44t.messenger.aosp.RecyclerView;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.ui.ActionBar.BottomSheet;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.Cells.PhotoAttachPhotoCell;
|
||||
import com.b44t.ui.ChatActivity;
|
||||
import com.b44t.ui.PhotoViewer;
|
||||
import com.b44t.messenger.ActionBar.BottomSheet;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.Cells.PhotoAttachPhotoCell;
|
||||
import com.b44t.messenger.ChatActivity;
|
||||
import com.b44t.messenger.PhotoViewer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -757,7 +756,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
|
||||
}
|
||||
|
||||
private void setUseRevealAnimation(boolean value) {
|
||||
if (!value || value && Build.VERSION.SDK_INT >= 18 && !AndroidUtilities.isTablet()) {
|
||||
if (!value || value && Build.VERSION.SDK_INT >= 18) {
|
||||
useRevealAnimation = value;
|
||||
}
|
||||
}
|
||||
+9
-13
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,10 +21,9 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
@@ -35,12 +34,11 @@ import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ContactsController;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.TLRPC;
|
||||
import com.b44t.ui.ActionBar.ActionBar;
|
||||
import com.b44t.ui.ActionBar.SimpleTextView;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.ChatActivity;
|
||||
import com.b44t.ui.ProfileActivity;
|
||||
import com.b44t.messenger.ActionBar.ActionBar;
|
||||
import com.b44t.messenger.ActionBar.SimpleTextView;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.ChatActivity;
|
||||
import com.b44t.messenger.ProfileActivity;
|
||||
|
||||
public class ChatAvatarContainer extends FrameLayout {
|
||||
|
||||
@@ -62,7 +60,6 @@ public class ChatAvatarContainer extends FrameLayout {
|
||||
titleTextView.setTextColor(Theme.ACTION_BAR_TITLE_COLOR);
|
||||
titleTextView.setTextSize(18);
|
||||
titleTextView.setGravity(Gravity.START);
|
||||
titleTextView.setLeftDrawableTopPadding(-AndroidUtilities.dp(1.3f));
|
||||
titleTextView.setRightDrawableTopPadding(-AndroidUtilities.dp(1.3f));
|
||||
addView(titleTextView);
|
||||
|
||||
@@ -76,7 +73,7 @@ public class ChatAvatarContainer extends FrameLayout {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle args = new Bundle();
|
||||
if( parentFragment.m_mrChat.getType()== MrChat.MR_CHAT_GROUP ) {
|
||||
if( parentFragment.m_mrChat.isGroup() ) {
|
||||
args.putInt("chat_id", parentFragment.m_mrChat.getId());
|
||||
}
|
||||
else {
|
||||
@@ -88,7 +85,6 @@ public class ChatAvatarContainer extends FrameLayout {
|
||||
}
|
||||
|
||||
ProfileActivity fragment = new ProfileActivity(args);
|
||||
fragment.setPlayProfileAnimation(true);
|
||||
parentFragment.presentFragment(fragment);
|
||||
}
|
||||
});
|
||||
@@ -114,7 +110,7 @@ public class ChatAvatarContainer extends FrameLayout {
|
||||
}
|
||||
|
||||
public void setTitleIcons(int leftIcon, int rightIcon) {
|
||||
titleTextView.setLeftDrawable(leftIcon);
|
||||
subtitleTextView.setLeftDrawable(leftIcon);
|
||||
titleTextView.setRightDrawable(rightIcon);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.Drawable;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.TypedValue;
|
||||
@@ -32,7 +32,6 @@ import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.R;
|
||||
|
||||
public class EmptyTextProgressView extends FrameLayout {
|
||||
+37
-34
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,28 +21,27 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.KeepAliveService;
|
||||
|
||||
import static com.b44t.messenger.ApplicationLoader.applicationContext;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class ForegroundDetector implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
public interface Listener {
|
||||
void onBecameForeground();
|
||||
void onBecameBackground();
|
||||
}
|
||||
|
||||
private int refs;
|
||||
private int refs = 0;
|
||||
private boolean wasInBackground = true;
|
||||
private long enterBackgroundTime = 0;
|
||||
private CopyOnWriteArrayList<Listener> listeners = new CopyOnWriteArrayList<>();
|
||||
private static ForegroundDetector Instance = null;
|
||||
|
||||
public static ForegroundDetector getInstance() {
|
||||
@@ -62,29 +61,22 @@ public class ForegroundDetector implements Application.ActivityLifecycleCallback
|
||||
return refs == 0;
|
||||
}
|
||||
|
||||
public void addListener(Listener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeListener(Listener listener) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
if (++refs == 1) {
|
||||
Log.i("DeltaChat", "-------------------- Activity started --------------------");
|
||||
|
||||
refs++;
|
||||
if (refs == 1) {
|
||||
if (System.currentTimeMillis() - enterBackgroundTime < 200) {
|
||||
wasInBackground = false;
|
||||
}
|
||||
//Log.i("DeltaChat", "switch to foreground");
|
||||
for (Listener listener : listeners) {
|
||||
try {
|
||||
listener.onBecameForeground();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
applicationContext.stopService(new Intent(applicationContext, KeepAliveService.class));
|
||||
|
||||
//ApplicationLoader.imapForeground = true;
|
||||
ApplicationLoader.startThreads(); // we call this without checking getPermanentPush() to have a simple guarantee that push is always active when the app is in foregroud (startIdleThread makes sure the thread is not started twice)
|
||||
}
|
||||
|
||||
public boolean isWasInBackground(boolean reset) {
|
||||
@@ -100,17 +92,27 @@ public class ForegroundDetector implements Application.ActivityLifecycleCallback
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
if (--refs == 0) {
|
||||
|
||||
Log.i("DeltaChat", "-------------------- Activity stopped --------------------");
|
||||
|
||||
if( refs <= 0 ) {
|
||||
Log.i("DeltaChat", String.format("Bad activity count: activityCount=%d", refs));
|
||||
return;
|
||||
}
|
||||
|
||||
refs--;
|
||||
if (refs == 0) {
|
||||
enterBackgroundTime = System.currentTimeMillis();
|
||||
wasInBackground = true;
|
||||
//Log.i("DeltaChat", "switch to background");
|
||||
for (Listener listener : listeners) {
|
||||
try {
|
||||
listener.onBecameBackground();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
ApplicationLoader.afterForgroundWakeLock.acquire(60*1000);
|
||||
|
||||
/*if( !ApplicationLoader.getPermanentPush() ) {
|
||||
ApplicationLoader.scheduleStopImapThread();;
|
||||
}*/
|
||||
}
|
||||
else {
|
||||
Log.i("DeltaChat", String.format("Not yet switched to background, %d activities left", refs));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +126,7 @@ public class ForegroundDetector implements Application.ActivityLifecycleCallback
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
// pause/resume will also be called when the app is partially covered by a dialog
|
||||
}
|
||||
|
||||
@Override
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.graphics.Path;
|
||||
import android.text.StaticLayout;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.ObjectAnimator;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+6
-18
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -61,13 +61,12 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.NotificationCenter;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.UserConfig;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
@@ -159,7 +158,6 @@ public class PasscodeView extends FrameLayout {
|
||||
passwordEditText.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
passwordEditText.setTypeface(Typeface.DEFAULT);
|
||||
passwordEditText.setBackgroundDrawable(null);
|
||||
AndroidUtilities.clearCursorDrawable(passwordEditText);
|
||||
passwordFrameLayout.addView(passwordEditText);
|
||||
layoutParams = (FrameLayout.LayoutParams) passwordEditText.getLayoutParams();
|
||||
layoutParams.height = LayoutHelper.WRAP_CONTENT;
|
||||
@@ -531,7 +529,7 @@ public class PasscodeView extends FrameLayout {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
builder.setView(relativeLayout);
|
||||
builder.setNegativeButton(ApplicationLoader.applicationContext.getString(R.string.Cancel), null);
|
||||
builder.setNegativeButton(R.string.Cancel, null);
|
||||
builder.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
@@ -666,7 +664,7 @@ public class PasscodeView extends FrameLayout {
|
||||
|
||||
LayoutParams layoutParams;
|
||||
|
||||
if (!AndroidUtilities.isTablet() && getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
if (getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
layoutParams = (LayoutParams) passwordFrameLayout.getLayoutParams();
|
||||
layoutParams.width = UserConfig.passcodeType == 0 ? width / 2 : width;
|
||||
layoutParams.height = AndroidUtilities.dp(140);
|
||||
@@ -682,16 +680,6 @@ public class PasscodeView extends FrameLayout {
|
||||
} else {
|
||||
int top = 0;
|
||||
int left = 0;
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
if (width > AndroidUtilities.dp(498)) {
|
||||
left = (width - AndroidUtilities.dp(498)) / 2;
|
||||
width = AndroidUtilities.dp(498);
|
||||
}
|
||||
if (height > AndroidUtilities.dp(528)) {
|
||||
top = (height - AndroidUtilities.dp(528)) / 2;
|
||||
height = AndroidUtilities.dp(528);
|
||||
}
|
||||
}
|
||||
layoutParams = (LayoutParams) passwordFrameLayout.getLayoutParams();
|
||||
layoutParams.height = height / 3;
|
||||
layoutParams.width = width;
|
||||
@@ -759,7 +747,7 @@ public class PasscodeView extends FrameLayout {
|
||||
getWindowVisibleDisplayFrame(rect);
|
||||
keyboardHeight = usableViewHeight - (rect.bottom - rect.top);
|
||||
|
||||
if (UserConfig.passcodeType == 1 && (AndroidUtilities.isTablet() || getContext().getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE)) {
|
||||
if (UserConfig.passcodeType == 1 && getContext().getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
|
||||
int t = 0;
|
||||
if (passwordFrameLayout.getTag() != null) {
|
||||
t = (Integer) passwordFrameLayout.getTag();
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
+7
-21
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -49,15 +49,14 @@ import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ApplicationLoader;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.support.widget.LinearLayoutManager;
|
||||
import com.b44t.messenger.support.widget.RecyclerView;
|
||||
import com.b44t.messenger.aosp.LinearLayoutManager;
|
||||
import com.b44t.messenger.aosp.RecyclerView;
|
||||
import com.b44t.messenger.DispatchQueue;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.messenger.Utilities;
|
||||
import com.b44t.messenger.AnimatorListenerAdapterProxy;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.ui.Cells.PhotoEditToolCell;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
import com.b44t.messenger.Cells.PhotoEditToolCell;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
@@ -2292,7 +2291,7 @@ public class PhotoFilterView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
});
|
||||
editView.addView(valueSeekBar, LayoutHelper.createFrame(AndroidUtilities.isTablet() ? 498 : LayoutHelper.MATCH_PARENT, 60, AndroidUtilities.isTablet() ? Gravity.CENTER_HORIZONTAL | Gravity.TOP : Gravity.START | Gravity.TOP, 14, 10, 14, 0));
|
||||
editView.addView(valueSeekBar, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 60, Gravity.START | Gravity.TOP, 14, 10, 14, 0));
|
||||
|
||||
curveLayout = new FrameLayout(context);
|
||||
editView.addView(curveLayout, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 78, Gravity.CENTER_HORIZONTAL));
|
||||
@@ -2699,19 +2698,6 @@ public class PhotoFilterView extends FrameLayout {
|
||||
layoutParams = (LayoutParams) curvesControl.getLayoutParams();
|
||||
layoutParams.height = viewHeight + AndroidUtilities.dp(28);
|
||||
curvesControl.setLayoutParams(layoutParams);
|
||||
|
||||
if (AndroidUtilities.isTablet()) {
|
||||
int total = AndroidUtilities.dp(86) * 10;
|
||||
layoutParams = (FrameLayout.LayoutParams) recyclerListView.getLayoutParams();
|
||||
if (total < viewWidth) {
|
||||
layoutParams.width = total;
|
||||
layoutParams.leftMargin = (viewWidth - total) / 2;
|
||||
} else {
|
||||
layoutParams.width = LayoutHelper.MATCH_PARENT;
|
||||
layoutParams.leftMargin = 0;
|
||||
}
|
||||
recyclerListView.setLayoutParams(layoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
+3
-4
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
@@ -33,9 +33,8 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.LocaleController;
|
||||
import com.b44t.messenger.R;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
public class PickerBottomLayout extends FrameLayout {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
public class Point {
|
||||
public float x;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
@@ -34,7 +34,7 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.view.View;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.ui.ActionBar.Theme;
|
||||
import com.b44t.messenger.ActionBar.Theme;
|
||||
|
||||
public class RadioButton extends View {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
public class Rect {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -34,7 +34,7 @@ import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.support.widget.RecyclerView;
|
||||
import com.b44t.messenger.aosp.RecyclerView;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.SensorManager;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
public class Size {
|
||||
public float width;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Messenger Android Frontend
|
||||
* Delta Chat Android
|
||||
* (C) 2013-2016 Nikolai Kudashov
|
||||
* (C) 2017 Björn Petersen
|
||||
* Contact: r10s@b44t.com, http://b44t.com
|
||||
@@ -21,7 +21,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
package com.b44t.ui.Components;
|
||||
package com.b44t.messenger.Components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user