how can I give shadow to layout of android
I just want to add Shadow to my android xml layout file. anyone help me to : How can I add shadow to my Layout Like This.....?
do you know?
how many words do you know
See also questions close to this topic
-
Updating a Single Column In Room Database
That's the function I'm using for updat
private fun updateSettingsDatabase(settingsDao: SettingsDao) { lifecycleScope.launch { settingsDao.update(SettingsEntity( 1, nightMode=nightModeResult, )) } } @Query("SELECT * FROM `settings-table`") fun fetchCurrentSettings(): Flow<List<SettingsEntity>>
I specified
nightMode=
because I thought that this way I'm only updating this colummn, but it turns out that it resets every column, how do I update a single column, while keeping the values the rest of the columns? -
Using EdittextPreference for Goto search
sorry for my poor English. I want to use EditTextPreference in my bottom nav like the pic below, ![screenshot][1]
I have recycleview xml in my project with in many sub cardview layouts(which is scrollable) and I want to create item in the bottom nav which is called "Goto". When the "Goto" item is clicked i want it to pop-up like the screenshot. And when user enters a number(according to the cardviews i.e if the number of cardview is 40 user must enter 1-40) I want to search the cardview by its ID. Thank you and I hope u got it, If u have any questions let me know [1]: https://i.stack.imgur.com/grK8P.jpg
My xml format look like this. As you see in the blow since the cardviews are huge in number it is not cool to scroll all the way down that is why i need Goto item in the bottom nav to search it by its ID when the user click number in the EditTextPreference as u see in the screenshot. i.e The screenshot is not from my app
<LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> <LinearLayout> <androidx.cardview.widget.CardView> <RealtiveLayout> <Textview/> <RealtiveLayout> </androidx.cardview.widget.CardView> </LinearLayout> .. .. .. .. many more..
-
IOS Launcher in android studio
I'm trying to change the whole Android OS installed app icons into IOS icons, please help me with the proper code or library for android kotlin
-
Java - Update Elements in Large XML Files
I work with very large XML datasets (1 GB+) and need to backtrack and update specific elements per node, depending on the values of other elements that follow.
For example, in this record/node:
<user> <role>Associate</role> <team>Hufflepuff</team> <experience>7</experience> </user>
Since "experience" is greater than 5 years, the role needs to be updated from "Associate" to "Senior."
I would like to avoid loading the entire file into memory via the DOM.
Ideally, I would process each single "user" in the XML and append the data to a new XML file one at a time. I started off by processing in a stream using StAX, but I don't know how to transform each XMLEventWriter event content into a useable DOM document that writes to an XML file and clears from memory afterwards.
If the description is unclear in any way, please let me know. Any help on this will be greatly appreciated.
Thanks.
-
cant read field in xml section
Using python I got to the correct iteration of the XML (forecast) section, but one child field I cant seem to be able to read here is the section from the XML
<forecast> <fcst_time_from>2022-05-04T16:00:00Z</fcst_time_from> <fcst_time_to>2022-05-04T20:00:00Z</fcst_time_to> <change_indicator>FM</change_indicator> <wind_dir_degrees>110</wind_dir_degrees> <wind_speed_kt>6</wind_speed_kt> <visibility_statute_mi>6.21</visibility_statute_mi> <sky_condition sky_cover="SCT" cloud_base_ft_agl="4500"/> <sky_condition sky_cover="SCT" cloud_base_ft_agl="25000"/> </forecast>
I can get every field except
<sky_condition sky_cover="SCT" cloud_base_ft_agl="25000"/>
here is the code where I pull the fields
if startTime_new <= Cur_Date_UTC <= EndTime_new: #Cil2 = (l.find('sky_cover')).text wDir = (l.find('wind_dir_degrees')).text wSpd = (l.find('wind_speed_kt')).text vis = (l.find('visibility_statute_mi')).text Cil = (l.find('sky_condition')).text print(wDir) print(wSpd) print(vis) print(Cil) print(l)
The answer given did work in a comand window but I am using beautifulsoup to get the XML . I tried to import from datetime import datetime however Cil = [x.get('sky_cover') for x in elt.findall('sky_condition')] did not work
here is my full code
from bs4 import BeautifulSoup as bs import requests import pytz from datetime import datetime #pirip=False def SetDateTimes(): utc_time = datetime.now(pytz.utc) Cur_Date_UTC = utc_time.strftime("%d/%m/%y %H:%M:%S") return Cur_Date_UTC def FixDateTime(workingTime): workingTime = workingTime.replace('T', ' ') workingTime = workingTime.replace('Z', '') format = "%Y-%m-%d %H:%M:%S" dt_object = datetime.strptime(workingTime, format) day_st = dt_object.strftime("%d") month_st = dt_object.strftime("%m") year_st = dt_object.strftime("%y") time_st = dt_object.strftime("%H:%M:%S") workingTime = day_st + '/' + month_st + '/' + year_st + ' ' + time_st return workingTime def GetTAF3(): USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36" url = 'https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=tafs&requestType=retrieve&format=xml&hoursBeforeNow=3&timeType=issue&mostRecent=true&stationString=KEWR' session = requests.Session() session.headers['User-Agent'] = USER_AGENT html = session.get(url) soup = bs(html.text, 'html.parser') taf = soup.find_all("forecast") for l in soup.findAll('forecast'): startTime = l.find('fcst_time_from').text EndTime = (l.find('fcst_time_to')).text #print(startTime) startTime_new = FixDateTime(startTime) #print(startTime_new) #print(EndTime) EndTime_new = FixDateTime(EndTime) #print(EndTime_new) #break if startTime_new <= Cur_Date_UTC <= EndTime_new: #Cil2 = (l.find('sky_cover')).text print(l) wDir = (l.find('wind_dir_degrees')).text wSpd = (l.find('wind_speed_kt')).text vis = (l.find('visibility_statute_mi')).text Cil = (l.find('sky_condition')) print(wDir) print(wSpd) print(vis) print(Cil) print(l) if 'OVC' in Cil: print("OVC Found") pirip = True else: print('No PIRIP') if float(vis) < 5: print("pirip for vis") pirip = True else: print('No PIRIP') Cur_Date_UTC = SetDateTimes() GetTAF3() #print(pirip)
-
How can I use Continue in a choose statement in xslt
I want to continue to check for other if statements if the first one is met. From what I read, Choose statement does not have this functionality like other languages do. One post suggested to just run multiple if statements but this is not working. After the first if statement is met it stops there, I want it to keep running.
How can I achieve this? This is my code:
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="root"> { "entityList": [ <xsl:for-each select="//entityList"> { "notes":"<xsl:call-template name="replace"> <xsl:with-param name="text" select="./Notes"/> </xsl:call-template>", } <xsl:if test="position() != last()">,</xsl:if> </xsl:for-each> ] } </xsl:template> <xsl:template name="replace"> <xsl:param name="text"/> <xsl:param name="searchString">"</xsl:param> <xsl:param name="replaceString">\"</xsl:param> <xsl:param name="searchStringSpace">	</xsl:param> <xsl:param name="searchStringBackslash">\</xsl:param> <xsl:if test="contains($text,$searchString)"> <xsl:value-of select="replace(./Notes,'"','\\"')"/> </xsl:if> <xsl:if test="contains($text,$searchStringSpace)"> <xsl:value-of select="replace(./Notes,'	','\\t')"/> </xsl:if> </xsl:template> </xsl:stylesheet>
<root> <totalRecords>429</totalRecords> <offset>0</offset> <entityList> <Notes>Dear Deans, Chairs and "Directors,There was a 	ANDOR question about scheduling Mac Hall Auditorium,for regular classes and policy/procedure around it.,Mac Hall Auditorium was intended to be available as a,regular classroom. That is why the seats have built-in mini,desks.,Your programs are welcome to schedule classes in,Mac Auditorium - you can request it when submitting your,course schedules for the Semester or through the Schedule,Change Request Form.,There are, however, some conditions:,1)faculty members who teach in Mac Auditorium should,anticipate that their class may be displaced if the,University-wide function (president?s address, a conference,,etc.) is scheduled at the time of their class. It would be,up to the faculty to either reschedule that,class meeting for a different time, find another room/space,or substitute the class meeting with an alternative activity,There is no easy way to inform faculty about the upcoming,events, so they would have to watch University Calendar to,determine when their classes might be affected.,2)Mac Hall will be unavailable for scheduling regular,courses during evening hours (6-10 pm) ? that time will be,set aside for Pegasus Players practices.,Natalia F. Blank, Ph.D. 2/17/21</Notes> </entityList> <totalPages>1</totalPages> <page>0</page> <status>success</status> </root>
-
different between call view by name or use binding in android
i'am a newest in android kotlin
I want to know what is the difference between the two lines of code below and which one is better to use
class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMaindinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) bindins = DataBindingutil.setContentview( this, R.layout.activity_main) textview.text="text"//or binding.textview.text="text" }}
-
Is anyone implemented layout camera feature like Instagram in Android?
I have already tried with single activity and multiple fragment which is added programmatically as per layout(2x2,2x3) same as instagram.
But when i load camera on first fragment its working fine but when it moves to second fragment it stuck.
Used one Camera Fragment with different fragment container as per need.
I have used cameraview by natario1 and cameraX. But in both result not getting as per need.
If anyone done Please give me reference.
Thanks
Below is example of functionality